Lines Matching refs:task
58 static void call_start(struct rpc_task *task);
59 static void call_reserve(struct rpc_task *task);
60 static void call_reserveresult(struct rpc_task *task);
61 static void call_allocate(struct rpc_task *task);
62 static void call_encode(struct rpc_task *task);
63 static void call_decode(struct rpc_task *task);
64 static void call_bind(struct rpc_task *task);
65 static void call_bind_status(struct rpc_task *task);
66 static void call_transmit(struct rpc_task *task);
67 static void call_status(struct rpc_task *task);
68 static void call_transmit_status(struct rpc_task *task);
69 static void call_refresh(struct rpc_task *task);
70 static void call_refreshresult(struct rpc_task *task);
71 static void call_connect(struct rpc_task *task);
72 static void call_connect_status(struct rpc_task *task);
74 static int rpc_encode_header(struct rpc_task *task,
76 static int rpc_decode_header(struct rpc_task *task,
79 static void rpc_check_timeout(struct rpc_task *task);
1018 void rpc_task_release_transport(struct rpc_task *task) in rpc_task_release_transport() argument
1020 struct rpc_xprt *xprt = task->tk_xprt; in rpc_task_release_transport()
1023 task->tk_xprt = NULL; in rpc_task_release_transport()
1024 if (task->tk_client) in rpc_task_release_transport()
1025 rpc_task_release_xprt(task->tk_client, xprt); in rpc_task_release_transport()
1032 void rpc_task_release_client(struct rpc_task *task) in rpc_task_release_client() argument
1034 struct rpc_clnt *clnt = task->tk_client; in rpc_task_release_client()
1036 rpc_task_release_transport(task); in rpc_task_release_client()
1040 list_del(&task->tk_task); in rpc_task_release_client()
1042 task->tk_client = NULL; in rpc_task_release_client()
1066 void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_transport() argument
1068 if (task->tk_xprt) in rpc_task_set_transport()
1070 if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) in rpc_task_set_transport()
1071 task->tk_xprt = rpc_task_get_first_xprt(clnt); in rpc_task_set_transport()
1073 task->tk_xprt = rpc_task_get_next_xprt(clnt); in rpc_task_set_transport()
1077 void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_client() argument
1079 rpc_task_set_transport(task, clnt); in rpc_task_set_client()
1080 task->tk_client = clnt; in rpc_task_set_client()
1083 task->tk_flags |= RPC_TASK_SOFT; in rpc_task_set_client()
1085 task->tk_flags |= RPC_TASK_TIMEOUT; in rpc_task_set_client()
1087 task->tk_flags |= RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_task_set_client()
1089 task->tk_flags |= RPC_TASK_SWAPPER; in rpc_task_set_client()
1092 list_add_tail(&task->tk_task, &clnt->cl_tasks); in rpc_task_set_client()
1097 rpc_task_set_rpc_message(struct rpc_task *task, const struct rpc_message *msg) in rpc_task_set_rpc_message() argument
1100 task->tk_msg.rpc_proc = msg->rpc_proc; in rpc_task_set_rpc_message()
1101 task->tk_msg.rpc_argp = msg->rpc_argp; in rpc_task_set_rpc_message()
1102 task->tk_msg.rpc_resp = msg->rpc_resp; in rpc_task_set_rpc_message()
1103 task->tk_msg.rpc_cred = msg->rpc_cred; in rpc_task_set_rpc_message()
1104 if (!(task->tk_flags & RPC_TASK_CRED_NOREF)) in rpc_task_set_rpc_message()
1105 get_cred(task->tk_msg.rpc_cred); in rpc_task_set_rpc_message()
1113 rpc_default_callback(struct rpc_task *task, void *data) in rpc_default_callback() argument
1127 struct rpc_task *task; in rpc_run_task() local
1129 task = rpc_new_task(task_setup_data); in rpc_run_task()
1131 if (!RPC_IS_ASYNC(task)) in rpc_run_task()
1132 task->tk_flags |= RPC_TASK_CRED_NOREF; in rpc_run_task()
1134 rpc_task_set_client(task, task_setup_data->rpc_client); in rpc_run_task()
1135 rpc_task_set_rpc_message(task, task_setup_data->rpc_message); in rpc_run_task()
1137 if (task->tk_action == NULL) in rpc_run_task()
1138 rpc_call_start(task); in rpc_run_task()
1140 atomic_inc(&task->tk_count); in rpc_run_task()
1141 rpc_execute(task); in rpc_run_task()
1142 return task; in rpc_run_task()
1154 struct rpc_task *task; in rpc_call_sync() local
1170 task = rpc_run_task(&task_setup_data); in rpc_call_sync()
1171 if (IS_ERR(task)) in rpc_call_sync()
1172 return PTR_ERR(task); in rpc_call_sync()
1173 status = task->tk_status; in rpc_call_sync()
1174 rpc_put_task(task); in rpc_call_sync()
1191 struct rpc_task *task; in rpc_call_async() local
1200 task = rpc_run_task(&task_setup_data); in rpc_call_async()
1201 if (IS_ERR(task)) in rpc_call_async()
1202 return PTR_ERR(task); in rpc_call_async()
1203 rpc_put_task(task); in rpc_call_async()
1209 static void call_bc_encode(struct rpc_task *task);
1218 struct rpc_task *task; in rpc_run_bc_task() local
1229 task = rpc_new_task(&task_setup_data); in rpc_run_bc_task()
1230 xprt_init_bc_request(req, task); in rpc_run_bc_task()
1232 task->tk_action = call_bc_encode; in rpc_run_bc_task()
1233 atomic_inc(&task->tk_count); in rpc_run_bc_task()
1234 WARN_ON_ONCE(atomic_read(&task->tk_count) != 2); in rpc_run_bc_task()
1235 rpc_execute(task); in rpc_run_bc_task()
1237 dprintk("RPC: rpc_run_bc_task: task= %p\n", task); in rpc_run_bc_task()
1238 return task; in rpc_run_bc_task()
1263 rpc_call_start(struct rpc_task *task) in rpc_call_start() argument
1265 task->tk_action = call_start; in rpc_call_start()
1563 __rpc_restart_call(struct rpc_task *task, void (*action)(struct rpc_task *)) in __rpc_restart_call() argument
1565 task->tk_status = 0; in __rpc_restart_call()
1566 task->tk_rpc_status = 0; in __rpc_restart_call()
1567 task->tk_action = action; in __rpc_restart_call()
1576 rpc_restart_call(struct rpc_task *task) in rpc_restart_call() argument
1578 return __rpc_restart_call(task, call_start); in rpc_restart_call()
1587 rpc_restart_call_prepare(struct rpc_task *task) in rpc_restart_call_prepare() argument
1589 if (task->tk_ops->rpc_call_prepare != NULL) in rpc_restart_call_prepare()
1590 return __rpc_restart_call(task, rpc_prepare_task); in rpc_restart_call_prepare()
1591 return rpc_restart_call(task); in rpc_restart_call_prepare()
1596 *rpc_proc_name(const struct rpc_task *task) in rpc_proc_name() argument
1598 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in rpc_proc_name()
1610 __rpc_call_rpcerror(struct rpc_task *task, int tk_status, int rpc_status) in __rpc_call_rpcerror() argument
1612 trace_rpc_call_rpcerror(task, tk_status, rpc_status); in __rpc_call_rpcerror()
1613 task->tk_rpc_status = rpc_status; in __rpc_call_rpcerror()
1614 rpc_exit(task, tk_status); in __rpc_call_rpcerror()
1618 rpc_call_rpcerror(struct rpc_task *task, int status) in rpc_call_rpcerror() argument
1620 __rpc_call_rpcerror(task, status, status); in rpc_call_rpcerror()
1630 call_start(struct rpc_task *task) in call_start() argument
1632 struct rpc_clnt *clnt = task->tk_client; in call_start()
1633 int idx = task->tk_msg.rpc_proc->p_statidx; in call_start()
1635 trace_rpc_request(task); in call_start()
1641 task->tk_action = call_reserve; in call_start()
1642 rpc_task_set_transport(task, clnt); in call_start()
1649 call_reserve(struct rpc_task *task) in call_reserve() argument
1651 task->tk_status = 0; in call_reserve()
1652 task->tk_action = call_reserveresult; in call_reserve()
1653 xprt_reserve(task); in call_reserve()
1656 static void call_retry_reserve(struct rpc_task *task);
1662 call_reserveresult(struct rpc_task *task) in call_reserveresult() argument
1664 int status = task->tk_status; in call_reserveresult()
1670 task->tk_status = 0; in call_reserveresult()
1672 if (task->tk_rqstp) { in call_reserveresult()
1673 task->tk_action = call_refresh; in call_reserveresult()
1677 rpc_call_rpcerror(task, -EIO); in call_reserveresult()
1683 rpc_delay(task, HZ >> 2); in call_reserveresult()
1686 task->tk_action = call_retry_reserve; in call_reserveresult()
1689 rpc_call_rpcerror(task, status); in call_reserveresult()
1697 call_retry_reserve(struct rpc_task *task) in call_retry_reserve() argument
1699 task->tk_status = 0; in call_retry_reserve()
1700 task->tk_action = call_reserveresult; in call_retry_reserve()
1701 xprt_retry_reserve(task); in call_retry_reserve()
1708 call_refresh(struct rpc_task *task) in call_refresh() argument
1710 task->tk_action = call_refreshresult; in call_refresh()
1711 task->tk_status = 0; in call_refresh()
1712 task->tk_client->cl_stats->rpcauthrefresh++; in call_refresh()
1713 rpcauth_refreshcred(task); in call_refresh()
1720 call_refreshresult(struct rpc_task *task) in call_refreshresult() argument
1722 int status = task->tk_status; in call_refreshresult()
1724 task->tk_status = 0; in call_refreshresult()
1725 task->tk_action = call_refresh; in call_refreshresult()
1728 if (rpcauth_uptodatecred(task)) { in call_refreshresult()
1729 task->tk_action = call_allocate; in call_refreshresult()
1737 rpc_delay(task, 3*HZ); in call_refreshresult()
1743 if (!task->tk_cred_retry) in call_refreshresult()
1745 task->tk_cred_retry--; in call_refreshresult()
1746 trace_rpc_retry_refresh_status(task); in call_refreshresult()
1749 trace_rpc_refresh_status(task); in call_refreshresult()
1750 rpc_call_rpcerror(task, status); in call_refreshresult()
1758 call_allocate(struct rpc_task *task) in call_allocate() argument
1760 const struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth; in call_allocate()
1761 struct rpc_rqst *req = task->tk_rqstp; in call_allocate()
1763 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in call_allocate()
1766 task->tk_status = 0; in call_allocate()
1767 task->tk_action = call_encode; in call_allocate()
1794 status = xprt->ops->buf_alloc(task); in call_allocate()
1795 trace_rpc_buf_alloc(task, status); in call_allocate()
1799 rpc_call_rpcerror(task, status); in call_allocate()
1803 if (RPC_IS_ASYNC(task) || !fatal_signal_pending(current)) { in call_allocate()
1804 task->tk_action = call_allocate; in call_allocate()
1805 rpc_delay(task, HZ>>4); in call_allocate()
1809 rpc_call_rpcerror(task, -ERESTARTSYS); in call_allocate()
1813 rpc_task_need_encode(struct rpc_task *task) in rpc_task_need_encode() argument
1815 return test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate) == 0 && in rpc_task_need_encode()
1816 (!(task->tk_flags & RPC_TASK_SENT) || in rpc_task_need_encode()
1817 !(task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) || in rpc_task_need_encode()
1818 xprt_request_need_retransmit(task)); in rpc_task_need_encode()
1822 rpc_xdr_encode(struct rpc_task *task) in rpc_xdr_encode() argument
1824 struct rpc_rqst *req = task->tk_rqstp; in rpc_xdr_encode()
1839 if (rpc_encode_header(task, &xdr)) in rpc_xdr_encode()
1842 task->tk_status = rpcauth_wrap_req(task, &xdr); in rpc_xdr_encode()
1849 call_encode(struct rpc_task *task) in call_encode() argument
1851 if (!rpc_task_need_encode(task)) in call_encode()
1855 xprt_request_dequeue_xprt(task); in call_encode()
1857 rpc_xdr_encode(task); in call_encode()
1859 if (task->tk_status != 0) { in call_encode()
1861 switch (task->tk_status) { in call_encode()
1864 rpc_delay(task, HZ >> 4); in call_encode()
1867 if (!task->tk_cred_retry) { in call_encode()
1868 rpc_exit(task, task->tk_status); in call_encode()
1870 task->tk_action = call_refresh; in call_encode()
1871 task->tk_cred_retry--; in call_encode()
1872 trace_rpc_retry_refresh_status(task); in call_encode()
1876 rpc_call_rpcerror(task, task->tk_status); in call_encode()
1882 if (rpc_reply_expected(task)) in call_encode()
1883 xprt_request_enqueue_receive(task); in call_encode()
1884 xprt_request_enqueue_transmit(task); in call_encode()
1886 task->tk_action = call_transmit; in call_encode()
1888 if (!xprt_bound(task->tk_xprt)) in call_encode()
1889 task->tk_action = call_bind; in call_encode()
1890 else if (!xprt_connected(task->tk_xprt)) in call_encode()
1891 task->tk_action = call_connect; in call_encode()
1899 rpc_task_transmitted(struct rpc_task *task) in rpc_task_transmitted() argument
1901 return !test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate); in rpc_task_transmitted()
1905 rpc_task_handle_transmitted(struct rpc_task *task) in rpc_task_handle_transmitted() argument
1907 xprt_end_transmit(task); in rpc_task_handle_transmitted()
1908 task->tk_action = call_transmit_status; in rpc_task_handle_transmitted()
1915 call_bind(struct rpc_task *task) in call_bind() argument
1917 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind()
1919 if (rpc_task_transmitted(task)) { in call_bind()
1920 rpc_task_handle_transmitted(task); in call_bind()
1925 task->tk_action = call_connect; in call_bind()
1929 task->tk_action = call_bind_status; in call_bind()
1930 if (!xprt_prepare_transmit(task)) in call_bind()
1933 xprt->ops->rpcbind(task); in call_bind()
1940 call_bind_status(struct rpc_task *task) in call_bind_status() argument
1942 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind_status()
1945 if (rpc_task_transmitted(task)) { in call_bind_status()
1946 rpc_task_handle_transmitted(task); in call_bind_status()
1950 if (task->tk_status >= 0) in call_bind_status()
1953 task->tk_status = 0; in call_bind_status()
1957 switch (task->tk_status) { in call_bind_status()
1959 rpc_delay(task, HZ >> 2); in call_bind_status()
1962 trace_rpcb_prog_unavail_err(task); in call_bind_status()
1964 if (task->tk_msg.rpc_proc->p_proc == 0) { in call_bind_status()
1968 if (task->tk_rebind_retry == 0) in call_bind_status()
1970 task->tk_rebind_retry--; in call_bind_status()
1971 rpc_delay(task, 3*HZ); in call_bind_status()
1974 rpc_delay(task, HZ >> 2); in call_bind_status()
1979 trace_rpcb_timeout_err(task); in call_bind_status()
1983 trace_rpcb_bind_version_err(task); in call_bind_status()
1986 trace_rpcb_bind_version_err(task); in call_bind_status()
1997 trace_rpcb_unreachable_err(task); in call_bind_status()
1998 if (!RPC_IS_SOFTCONN(task)) { in call_bind_status()
1999 rpc_delay(task, 5*HZ); in call_bind_status()
2002 status = task->tk_status; in call_bind_status()
2005 trace_rpcb_unrecognized_err(task); in call_bind_status()
2008 rpc_call_rpcerror(task, status); in call_bind_status()
2011 task->tk_action = call_connect; in call_bind_status()
2014 task->tk_status = 0; in call_bind_status()
2015 task->tk_action = call_bind; in call_bind_status()
2016 rpc_check_timeout(task); in call_bind_status()
2023 call_connect(struct rpc_task *task) in call_connect() argument
2025 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect()
2027 if (rpc_task_transmitted(task)) { in call_connect()
2028 rpc_task_handle_transmitted(task); in call_connect()
2033 task->tk_action = call_transmit; in call_connect()
2037 task->tk_action = call_connect_status; in call_connect()
2038 if (task->tk_status < 0) in call_connect()
2040 if (task->tk_flags & RPC_TASK_NOCONNECT) { in call_connect()
2041 rpc_call_rpcerror(task, -ENOTCONN); in call_connect()
2044 if (!xprt_prepare_transmit(task)) in call_connect()
2046 xprt_connect(task); in call_connect()
2053 call_connect_status(struct rpc_task *task) in call_connect_status() argument
2055 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect_status()
2056 struct rpc_clnt *clnt = task->tk_client; in call_connect_status()
2057 int status = task->tk_status; in call_connect_status()
2059 if (rpc_task_transmitted(task)) { in call_connect_status()
2060 rpc_task_handle_transmitted(task); in call_connect_status()
2064 trace_rpc_connect_status(task); in call_connect_status()
2066 if (task->tk_status == 0) { in call_connect_status()
2071 task->tk_status = 0; in call_connect_status()
2075 task->tk_status = 0; in call_connect_status()
2079 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2093 xprt_conditional_disconnect(task->tk_rqstp->rq_xprt, in call_connect_status()
2094 task->tk_rqstp->rq_connect_cookie); in call_connect_status()
2095 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2098 rpc_delay(task, 3*HZ); in call_connect_status()
2104 if (!(task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) && in call_connect_status()
2105 (task->tk_flags & RPC_TASK_MOVEABLE) && in call_connect_status()
2107 struct rpc_xprt *saved = task->tk_xprt; in call_connect_status()
2116 xprt_release(task); in call_connect_status()
2121 task->tk_xprt = NULL; in call_connect_status()
2122 task->tk_action = call_start; in call_connect_status()
2125 if (!task->tk_xprt) in call_connect_status()
2130 rpc_delay(task, HZ >> 2); in call_connect_status()
2133 rpc_call_rpcerror(task, status); in call_connect_status()
2136 task->tk_action = call_transmit; in call_connect_status()
2140 task->tk_action = call_bind; in call_connect_status()
2141 rpc_check_timeout(task); in call_connect_status()
2148 call_transmit(struct rpc_task *task) in call_transmit() argument
2150 if (rpc_task_transmitted(task)) { in call_transmit()
2151 rpc_task_handle_transmitted(task); in call_transmit()
2155 task->tk_action = call_transmit_status; in call_transmit()
2156 if (!xprt_prepare_transmit(task)) in call_transmit()
2158 task->tk_status = 0; in call_transmit()
2159 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_transmit()
2160 if (!xprt_connected(task->tk_xprt)) { in call_transmit()
2161 task->tk_status = -ENOTCONN; in call_transmit()
2164 xprt_transmit(task); in call_transmit()
2166 xprt_end_transmit(task); in call_transmit()
2173 call_transmit_status(struct rpc_task *task) in call_transmit_status() argument
2175 task->tk_action = call_status; in call_transmit_status()
2181 if (rpc_task_transmitted(task)) { in call_transmit_status()
2182 task->tk_status = 0; in call_transmit_status()
2183 xprt_request_wait_receive(task); in call_transmit_status()
2187 switch (task->tk_status) { in call_transmit_status()
2191 task->tk_status = 0; in call_transmit_status()
2192 task->tk_action = call_encode; in call_transmit_status()
2201 rpc_delay(task, HZ>>2); in call_transmit_status()
2205 task->tk_action = call_transmit; in call_transmit_status()
2206 task->tk_status = 0; in call_transmit_status()
2214 if (RPC_IS_SOFTCONN(task)) { in call_transmit_status()
2215 if (!task->tk_msg.rpc_proc->p_proc) in call_transmit_status()
2216 trace_xprt_ping(task->tk_xprt, in call_transmit_status()
2217 task->tk_status); in call_transmit_status()
2218 rpc_call_rpcerror(task, task->tk_status); in call_transmit_status()
2227 task->tk_action = call_bind; in call_transmit_status()
2228 task->tk_status = 0; in call_transmit_status()
2231 rpc_check_timeout(task); in call_transmit_status()
2235 static void call_bc_transmit(struct rpc_task *task);
2236 static void call_bc_transmit_status(struct rpc_task *task);
2239 call_bc_encode(struct rpc_task *task) in call_bc_encode() argument
2241 xprt_request_enqueue_transmit(task); in call_bc_encode()
2242 task->tk_action = call_bc_transmit; in call_bc_encode()
2250 call_bc_transmit(struct rpc_task *task) in call_bc_transmit() argument
2252 task->tk_action = call_bc_transmit_status; in call_bc_transmit()
2253 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_bc_transmit()
2254 if (!xprt_prepare_transmit(task)) in call_bc_transmit()
2256 task->tk_status = 0; in call_bc_transmit()
2257 xprt_transmit(task); in call_bc_transmit()
2259 xprt_end_transmit(task); in call_bc_transmit()
2263 call_bc_transmit_status(struct rpc_task *task) in call_bc_transmit_status() argument
2265 struct rpc_rqst *req = task->tk_rqstp; in call_bc_transmit_status()
2267 if (rpc_task_transmitted(task)) in call_bc_transmit_status()
2268 task->tk_status = 0; in call_bc_transmit_status()
2270 switch (task->tk_status) { in call_bc_transmit_status()
2284 rpc_delay(task, HZ>>2); in call_bc_transmit_status()
2288 task->tk_status = 0; in call_bc_transmit_status()
2289 task->tk_action = call_bc_transmit; in call_bc_transmit_status()
2300 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2310 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2313 task->tk_action = rpc_exit_task; in call_bc_transmit_status()
2321 call_status(struct rpc_task *task) in call_status() argument
2323 struct rpc_clnt *clnt = task->tk_client; in call_status()
2326 if (!task->tk_msg.rpc_proc->p_proc) in call_status()
2327 trace_xprt_ping(task->tk_xprt, task->tk_status); in call_status()
2329 status = task->tk_status; in call_status()
2331 task->tk_action = call_decode; in call_status()
2335 trace_rpc_call_status(task); in call_status()
2336 task->tk_status = 0; in call_status()
2343 if (RPC_IS_SOFTCONN(task)) in call_status()
2349 rpc_delay(task, 3*HZ); in call_status()
2360 rpc_delay(task, 3*HZ); in call_status()
2374 task->tk_action = call_encode; in call_status()
2376 rpc_check_timeout(task); in call_status()
2379 rpc_call_rpcerror(task, status); in call_status()
2392 rpc_check_timeout(struct rpc_task *task) in rpc_check_timeout() argument
2394 struct rpc_clnt *clnt = task->tk_client; in rpc_check_timeout()
2396 if (RPC_SIGNALLED(task)) { in rpc_check_timeout()
2397 rpc_call_rpcerror(task, -ERESTARTSYS); in rpc_check_timeout()
2401 if (xprt_adjust_timeout(task->tk_rqstp) == 0) in rpc_check_timeout()
2404 trace_rpc_timeout_status(task); in rpc_check_timeout()
2405 task->tk_timeouts++; in rpc_check_timeout()
2407 if (RPC_IS_SOFTCONN(task) && !rpc_check_connected(task->tk_rqstp)) { in rpc_check_timeout()
2408 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2412 if (RPC_IS_SOFT(task)) { in rpc_check_timeout()
2418 if ((task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) && in rpc_check_timeout()
2419 rpc_check_connected(task->tk_rqstp)) in rpc_check_timeout()
2426 task->tk_xprt->servername); in rpc_check_timeout()
2428 if (task->tk_flags & RPC_TASK_TIMEOUT) in rpc_check_timeout()
2429 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2431 __rpc_call_rpcerror(task, -EIO, -ETIMEDOUT); in rpc_check_timeout()
2435 if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) { in rpc_check_timeout()
2436 task->tk_flags |= RPC_CALL_MAJORSEEN; in rpc_check_timeout()
2441 task->tk_xprt->servername); in rpc_check_timeout()
2449 rpcauth_invalcred(task); in rpc_check_timeout()
2456 call_decode(struct rpc_task *task) in call_decode() argument
2458 struct rpc_clnt *clnt = task->tk_client; in call_decode()
2459 struct rpc_rqst *req = task->tk_rqstp; in call_decode()
2463 if (!task->tk_msg.rpc_proc->p_decode) { in call_decode()
2464 task->tk_action = rpc_exit_task; in call_decode()
2468 if (task->tk_flags & RPC_CALL_MAJORSEEN) { in call_decode()
2472 task->tk_xprt->servername); in call_decode()
2474 task->tk_flags &= ~RPC_CALL_MAJORSEEN; in call_decode()
2491 trace_rpc_xdr_recvfrom(task, &req->rq_rcv_buf); in call_decode()
2499 err = rpc_decode_header(task, &xdr); in call_decode()
2503 task->tk_action = rpc_exit_task; in call_decode()
2504 task->tk_status = rpcauth_unwrap_resp(task, &xdr); in call_decode()
2507 task->tk_status = 0; in call_decode()
2508 if (task->tk_client->cl_discrtry) in call_decode()
2511 task->tk_action = call_encode; in call_decode()
2512 rpc_check_timeout(task); in call_decode()
2515 task->tk_action = call_reserve; in call_decode()
2516 rpc_check_timeout(task); in call_decode()
2517 rpcauth_invalcred(task); in call_decode()
2519 xprt_release(task); in call_decode()
2524 rpc_encode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_encode_header() argument
2526 struct rpc_clnt *clnt = task->tk_client; in rpc_encode_header()
2527 struct rpc_rqst *req = task->tk_rqstp; in rpc_encode_header()
2540 *p = cpu_to_be32(task->tk_msg.rpc_proc->p_proc); in rpc_encode_header()
2542 error = rpcauth_marshcred(task, xdr); in rpc_encode_header()
2547 trace_rpc_bad_callhdr(task); in rpc_encode_header()
2548 rpc_call_rpcerror(task, error); in rpc_encode_header()
2553 rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_decode_header() argument
2555 struct rpc_clnt *clnt = task->tk_client; in rpc_decode_header()
2564 if (task->tk_rqstp->rq_rcv_buf.len & 3) in rpc_decode_header()
2576 error = rpcauth_checkverf(task, xdr); in rpc_decode_header()
2587 trace_rpc__prog_unavail(task); in rpc_decode_header()
2591 trace_rpc__prog_mismatch(task); in rpc_decode_header()
2595 trace_rpc__proc_unavail(task); in rpc_decode_header()
2600 trace_rpc__garbage_args(task); in rpc_decode_header()
2609 if (task->tk_garb_retry) { in rpc_decode_header()
2610 task->tk_garb_retry--; in rpc_decode_header()
2611 task->tk_action = call_encode; in rpc_decode_header()
2615 rpc_call_rpcerror(task, error); in rpc_decode_header()
2619 trace_rpc__unparsable(task); in rpc_decode_header()
2624 trace_rpc_bad_verifier(task); in rpc_decode_header()
2636 trace_rpc__mismatch(task); in rpc_decode_header()
2651 if (!task->tk_cred_retry) in rpc_decode_header()
2653 task->tk_cred_retry--; in rpc_decode_header()
2654 trace_rpc__stale_creds(task); in rpc_decode_header()
2659 if (!task->tk_garb_retry) in rpc_decode_header()
2661 task->tk_garb_retry--; in rpc_decode_header()
2662 trace_rpc__bad_creds(task); in rpc_decode_header()
2663 task->tk_action = call_encode; in rpc_decode_header()
2666 trace_rpc__auth_tooweak(task); in rpc_decode_header()
2668 task->tk_xprt->servername); in rpc_decode_header()
2693 rpc_null_call_prepare(struct rpc_task *task, void *data) in rpc_null_call_prepare() argument
2695 task->tk_flags &= ~RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_null_call_prepare()
2696 rpc_call_start(task); in rpc_null_call_prepare()
2734 struct rpc_task *task; in rpc_ping() local
2737 task = rpc_call_null_helper(clnt, NULL, NULL, 0, NULL, NULL); in rpc_ping()
2738 if (IS_ERR(task)) in rpc_ping()
2739 return PTR_ERR(task); in rpc_ping()
2740 status = task->tk_status; in rpc_ping()
2741 rpc_put_task(task); in rpc_ping()
2750 static void rpc_cb_add_xprt_done(struct rpc_task *task, void *calldata) in rpc_cb_add_xprt_done() argument
2754 if (task->tk_status == 0) in rpc_cb_add_xprt_done()
2785 struct rpc_task *task; in rpc_clnt_test_and_add_xprt() local
2806 task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_ASYNC, in rpc_clnt_test_and_add_xprt()
2809 rpc_put_task(task); in rpc_clnt_test_and_add_xprt()
2838 struct rpc_task *task; in rpc_clnt_setup_test_and_add_xprt() local
2849 task = rpc_call_null_helper(clnt, xprt, NULL, 0, NULL, NULL); in rpc_clnt_setup_test_and_add_xprt()
2850 if (IS_ERR(task)) { in rpc_clnt_setup_test_and_add_xprt()
2851 status = PTR_ERR(task); in rpc_clnt_setup_test_and_add_xprt()
2854 status = task->tk_status; in rpc_clnt_setup_test_and_add_xprt()
2855 rpc_put_task(task); in rpc_clnt_setup_test_and_add_xprt()
3019 const struct rpc_task *task) in rpc_show_task() argument
3023 if (RPC_IS_QUEUED(task)) in rpc_show_task()
3024 rpc_waitq = rpc_qname(task->tk_waitqueue); in rpc_show_task()
3027 task->tk_pid, task->tk_flags, task->tk_status, in rpc_show_task()
3028 clnt, task->tk_rqstp, rpc_task_timeout(task), task->tk_ops, in rpc_show_task()
3029 clnt->cl_program->name, clnt->cl_vers, rpc_proc_name(task), in rpc_show_task()
3030 task->tk_action, rpc_waitq); in rpc_show_task()
3036 struct rpc_task *task; in rpc_show_tasks() local
3043 list_for_each_entry(task, &clnt->cl_tasks, tk_task) { in rpc_show_tasks()
3048 rpc_show_task(clnt, task); in rpc_show_tasks()