Lines Matching refs:task
53 static void call_start(struct rpc_task *task);
54 static void call_reserve(struct rpc_task *task);
55 static void call_reserveresult(struct rpc_task *task);
56 static void call_allocate(struct rpc_task *task);
57 static void call_encode(struct rpc_task *task);
58 static void call_decode(struct rpc_task *task);
59 static void call_bind(struct rpc_task *task);
60 static void call_bind_status(struct rpc_task *task);
61 static void call_transmit(struct rpc_task *task);
62 static void call_status(struct rpc_task *task);
63 static void call_transmit_status(struct rpc_task *task);
64 static void call_refresh(struct rpc_task *task);
65 static void call_refreshresult(struct rpc_task *task);
66 static void call_connect(struct rpc_task *task);
67 static void call_connect_status(struct rpc_task *task);
69 static int rpc_encode_header(struct rpc_task *task,
71 static int rpc_decode_header(struct rpc_task *task,
75 static void rpc_check_timeout(struct rpc_task *task);
915 struct rpc_task *task; in rpc_cancel_tasks() local
924 list_for_each_entry(task, &clnt->cl_tasks, tk_task) { in rpc_cancel_tasks()
925 if (!RPC_IS_ACTIVATED(task)) in rpc_cancel_tasks()
927 if (!fnmatch(task, data)) in rpc_cancel_tasks()
929 rpc_task_try_cancel(task, error); in rpc_cancel_tasks()
1117 void rpc_task_release_transport(struct rpc_task *task) in rpc_task_release_transport() argument
1119 struct rpc_xprt *xprt = task->tk_xprt; in rpc_task_release_transport()
1122 task->tk_xprt = NULL; in rpc_task_release_transport()
1123 if (task->tk_client) in rpc_task_release_transport()
1124 rpc_task_release_xprt(task->tk_client, xprt); in rpc_task_release_transport()
1131 void rpc_task_release_client(struct rpc_task *task) in rpc_task_release_client() argument
1133 struct rpc_clnt *clnt = task->tk_client; in rpc_task_release_client()
1135 rpc_task_release_transport(task); in rpc_task_release_client()
1139 list_del(&task->tk_task); in rpc_task_release_client()
1141 task->tk_client = NULL; in rpc_task_release_client()
1165 void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_transport() argument
1167 if (task->tk_xprt) { in rpc_task_set_transport()
1168 if (!(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) && in rpc_task_set_transport()
1169 (task->tk_flags & RPC_TASK_MOVEABLE))) in rpc_task_set_transport()
1171 xprt_release(task); in rpc_task_set_transport()
1172 xprt_put(task->tk_xprt); in rpc_task_set_transport()
1174 if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) in rpc_task_set_transport()
1175 task->tk_xprt = rpc_task_get_first_xprt(clnt); in rpc_task_set_transport()
1177 task->tk_xprt = rpc_task_get_next_xprt(clnt); in rpc_task_set_transport()
1181 void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_client() argument
1183 rpc_task_set_transport(task, clnt); in rpc_task_set_client()
1184 task->tk_client = clnt; in rpc_task_set_client()
1187 task->tk_flags |= RPC_TASK_SOFT; in rpc_task_set_client()
1189 task->tk_flags |= RPC_TASK_TIMEOUT; in rpc_task_set_client()
1191 task->tk_flags |= RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_task_set_client()
1194 list_add_tail(&task->tk_task, &clnt->cl_tasks); in rpc_task_set_client()
1199 rpc_task_set_rpc_message(struct rpc_task *task, const struct rpc_message *msg) in rpc_task_set_rpc_message() argument
1202 task->tk_msg.rpc_proc = msg->rpc_proc; in rpc_task_set_rpc_message()
1203 task->tk_msg.rpc_argp = msg->rpc_argp; in rpc_task_set_rpc_message()
1204 task->tk_msg.rpc_resp = msg->rpc_resp; in rpc_task_set_rpc_message()
1205 task->tk_msg.rpc_cred = msg->rpc_cred; in rpc_task_set_rpc_message()
1206 if (!(task->tk_flags & RPC_TASK_CRED_NOREF)) in rpc_task_set_rpc_message()
1207 get_cred(task->tk_msg.rpc_cred); in rpc_task_set_rpc_message()
1215 rpc_default_callback(struct rpc_task *task, void *data) in rpc_default_callback() argument
1229 struct rpc_task *task; in rpc_run_task() local
1231 task = rpc_new_task(task_setup_data); in rpc_run_task()
1232 if (IS_ERR(task)) in rpc_run_task()
1233 return task; in rpc_run_task()
1235 if (!RPC_IS_ASYNC(task)) in rpc_run_task()
1236 task->tk_flags |= RPC_TASK_CRED_NOREF; in rpc_run_task()
1238 rpc_task_set_client(task, task_setup_data->rpc_client); in rpc_run_task()
1239 rpc_task_set_rpc_message(task, task_setup_data->rpc_message); in rpc_run_task()
1241 if (task->tk_action == NULL) in rpc_run_task()
1242 rpc_call_start(task); in rpc_run_task()
1244 atomic_inc(&task->tk_count); in rpc_run_task()
1245 rpc_execute(task); in rpc_run_task()
1246 return task; in rpc_run_task()
1258 struct rpc_task *task; in rpc_call_sync() local
1274 task = rpc_run_task(&task_setup_data); in rpc_call_sync()
1275 if (IS_ERR(task)) in rpc_call_sync()
1276 return PTR_ERR(task); in rpc_call_sync()
1277 status = task->tk_status; in rpc_call_sync()
1278 rpc_put_task(task); in rpc_call_sync()
1295 struct rpc_task *task; in rpc_call_async() local
1304 task = rpc_run_task(&task_setup_data); in rpc_call_async()
1305 if (IS_ERR(task)) in rpc_call_async()
1306 return PTR_ERR(task); in rpc_call_async()
1307 rpc_put_task(task); in rpc_call_async()
1313 static void call_bc_encode(struct rpc_task *task);
1324 struct rpc_task *task; in rpc_run_bc_task() local
1335 task = rpc_new_task(&task_setup_data); in rpc_run_bc_task()
1336 if (IS_ERR(task)) { in rpc_run_bc_task()
1338 return task; in rpc_run_bc_task()
1341 xprt_init_bc_request(req, task, timeout); in rpc_run_bc_task()
1343 task->tk_action = call_bc_encode; in rpc_run_bc_task()
1344 atomic_inc(&task->tk_count); in rpc_run_bc_task()
1345 WARN_ON_ONCE(atomic_read(&task->tk_count) != 2); in rpc_run_bc_task()
1346 rpc_execute(task); in rpc_run_bc_task()
1348 dprintk("RPC: rpc_run_bc_task: task= %p\n", task); in rpc_run_bc_task()
1349 return task; in rpc_run_bc_task()
1374 rpc_call_start(struct rpc_task *task) in rpc_call_start() argument
1376 task->tk_action = call_start; in rpc_call_start()
1674 __rpc_restart_call(struct rpc_task *task, void (*action)(struct rpc_task *)) in __rpc_restart_call() argument
1676 task->tk_status = 0; in __rpc_restart_call()
1677 task->tk_rpc_status = 0; in __rpc_restart_call()
1678 task->tk_action = action; in __rpc_restart_call()
1687 rpc_restart_call(struct rpc_task *task) in rpc_restart_call() argument
1689 return __rpc_restart_call(task, call_start); in rpc_restart_call()
1698 rpc_restart_call_prepare(struct rpc_task *task) in rpc_restart_call_prepare() argument
1700 if (task->tk_ops->rpc_call_prepare != NULL) in rpc_restart_call_prepare()
1701 return __rpc_restart_call(task, rpc_prepare_task); in rpc_restart_call_prepare()
1702 return rpc_restart_call(task); in rpc_restart_call_prepare()
1707 *rpc_proc_name(const struct rpc_task *task) in rpc_proc_name() argument
1709 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in rpc_proc_name()
1721 __rpc_call_rpcerror(struct rpc_task *task, int tk_status, int rpc_status) in __rpc_call_rpcerror() argument
1723 trace_rpc_call_rpcerror(task, tk_status, rpc_status); in __rpc_call_rpcerror()
1724 rpc_task_set_rpc_status(task, rpc_status); in __rpc_call_rpcerror()
1725 rpc_exit(task, tk_status); in __rpc_call_rpcerror()
1729 rpc_call_rpcerror(struct rpc_task *task, int status) in rpc_call_rpcerror() argument
1731 __rpc_call_rpcerror(task, status, status); in rpc_call_rpcerror()
1741 call_start(struct rpc_task *task) in call_start() argument
1743 struct rpc_clnt *clnt = task->tk_client; in call_start()
1744 int idx = task->tk_msg.rpc_proc->p_statidx; in call_start()
1746 trace_rpc_request(task); in call_start()
1748 if (task->tk_client->cl_shutdown) { in call_start()
1749 rpc_call_rpcerror(task, -EIO); in call_start()
1757 task->tk_action = call_reserve; in call_start()
1758 rpc_task_set_transport(task, clnt); in call_start()
1765 call_reserve(struct rpc_task *task) in call_reserve() argument
1767 task->tk_status = 0; in call_reserve()
1768 task->tk_action = call_reserveresult; in call_reserve()
1769 xprt_reserve(task); in call_reserve()
1772 static void call_retry_reserve(struct rpc_task *task);
1778 call_reserveresult(struct rpc_task *task) in call_reserveresult() argument
1780 int status = task->tk_status; in call_reserveresult()
1786 task->tk_status = 0; in call_reserveresult()
1788 if (task->tk_rqstp) { in call_reserveresult()
1789 task->tk_action = call_refresh; in call_reserveresult()
1793 rpc_call_rpcerror(task, -EIO); in call_reserveresult()
1799 rpc_delay(task, HZ >> 2); in call_reserveresult()
1802 task->tk_action = call_retry_reserve; in call_reserveresult()
1805 rpc_call_rpcerror(task, status); in call_reserveresult()
1813 call_retry_reserve(struct rpc_task *task) in call_retry_reserve() argument
1815 task->tk_status = 0; in call_retry_reserve()
1816 task->tk_action = call_reserveresult; in call_retry_reserve()
1817 xprt_retry_reserve(task); in call_retry_reserve()
1824 call_refresh(struct rpc_task *task) in call_refresh() argument
1826 task->tk_action = call_refreshresult; in call_refresh()
1827 task->tk_status = 0; in call_refresh()
1828 task->tk_client->cl_stats->rpcauthrefresh++; in call_refresh()
1829 rpcauth_refreshcred(task); in call_refresh()
1836 call_refreshresult(struct rpc_task *task) in call_refreshresult() argument
1838 int status = task->tk_status; in call_refreshresult()
1840 task->tk_status = 0; in call_refreshresult()
1841 task->tk_action = call_refresh; in call_refreshresult()
1844 if (rpcauth_uptodatecred(task)) { in call_refreshresult()
1845 task->tk_action = call_allocate; in call_refreshresult()
1853 rpc_delay(task, 3*HZ); in call_refreshresult()
1859 if (!task->tk_cred_retry) in call_refreshresult()
1861 task->tk_cred_retry--; in call_refreshresult()
1862 trace_rpc_retry_refresh_status(task); in call_refreshresult()
1865 rpc_delay(task, HZ >> 4); in call_refreshresult()
1868 trace_rpc_refresh_status(task); in call_refreshresult()
1869 rpc_call_rpcerror(task, status); in call_refreshresult()
1877 call_allocate(struct rpc_task *task) in call_allocate() argument
1879 const struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth; in call_allocate()
1880 struct rpc_rqst *req = task->tk_rqstp; in call_allocate()
1882 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in call_allocate()
1885 task->tk_status = 0; in call_allocate()
1886 task->tk_action = call_encode; in call_allocate()
1907 status = xprt->ops->buf_alloc(task); in call_allocate()
1908 trace_rpc_buf_alloc(task, status); in call_allocate()
1912 rpc_call_rpcerror(task, status); in call_allocate()
1916 if (RPC_IS_ASYNC(task) || !fatal_signal_pending(current)) { in call_allocate()
1917 task->tk_action = call_allocate; in call_allocate()
1918 rpc_delay(task, HZ>>4); in call_allocate()
1922 rpc_call_rpcerror(task, -ERESTARTSYS); in call_allocate()
1926 rpc_task_need_encode(struct rpc_task *task) in rpc_task_need_encode() argument
1928 return test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate) == 0 && in rpc_task_need_encode()
1929 (!(task->tk_flags & RPC_TASK_SENT) || in rpc_task_need_encode()
1930 !(task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) || in rpc_task_need_encode()
1931 xprt_request_need_retransmit(task)); in rpc_task_need_encode()
1935 rpc_xdr_encode(struct rpc_task *task) in rpc_xdr_encode() argument
1937 struct rpc_rqst *req = task->tk_rqstp; in rpc_xdr_encode()
1951 if (rpc_encode_header(task, &xdr)) in rpc_xdr_encode()
1954 task->tk_status = rpcauth_wrap_req(task, &xdr); in rpc_xdr_encode()
1961 call_encode(struct rpc_task *task) in call_encode() argument
1963 if (!rpc_task_need_encode(task)) in call_encode()
1967 xprt_request_dequeue_xprt(task); in call_encode()
1969 rpc_xdr_encode(task); in call_encode()
1971 if (task->tk_status == 0 && rpc_reply_expected(task)) in call_encode()
1972 task->tk_status = xprt_request_enqueue_receive(task); in call_encode()
1974 if (task->tk_status != 0) { in call_encode()
1976 switch (task->tk_status) { in call_encode()
1979 rpc_delay(task, HZ >> 4); in call_encode()
1982 if (!task->tk_cred_retry) { in call_encode()
1983 rpc_call_rpcerror(task, task->tk_status); in call_encode()
1985 task->tk_action = call_refresh; in call_encode()
1986 task->tk_cred_retry--; in call_encode()
1987 trace_rpc_retry_refresh_status(task); in call_encode()
1991 rpc_call_rpcerror(task, task->tk_status); in call_encode()
1996 xprt_request_enqueue_transmit(task); in call_encode()
1998 task->tk_action = call_transmit; in call_encode()
2000 if (!xprt_bound(task->tk_xprt)) in call_encode()
2001 task->tk_action = call_bind; in call_encode()
2002 else if (!xprt_connected(task->tk_xprt)) in call_encode()
2003 task->tk_action = call_connect; in call_encode()
2011 rpc_task_transmitted(struct rpc_task *task) in rpc_task_transmitted() argument
2013 return !test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate); in rpc_task_transmitted()
2017 rpc_task_handle_transmitted(struct rpc_task *task) in rpc_task_handle_transmitted() argument
2019 xprt_end_transmit(task); in rpc_task_handle_transmitted()
2020 task->tk_action = call_transmit_status; in rpc_task_handle_transmitted()
2027 call_bind(struct rpc_task *task) in call_bind() argument
2029 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind()
2031 if (rpc_task_transmitted(task)) { in call_bind()
2032 rpc_task_handle_transmitted(task); in call_bind()
2037 task->tk_action = call_connect; in call_bind()
2041 task->tk_action = call_bind_status; in call_bind()
2042 if (!xprt_prepare_transmit(task)) in call_bind()
2045 xprt->ops->rpcbind(task); in call_bind()
2052 call_bind_status(struct rpc_task *task) in call_bind_status() argument
2054 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind_status()
2057 if (rpc_task_transmitted(task)) { in call_bind_status()
2058 rpc_task_handle_transmitted(task); in call_bind_status()
2062 if (task->tk_status >= 0) in call_bind_status()
2065 task->tk_status = 0; in call_bind_status()
2069 switch (task->tk_status) { in call_bind_status()
2071 rpc_delay(task, HZ >> 2); in call_bind_status()
2074 trace_rpcb_prog_unavail_err(task); in call_bind_status()
2076 if (task->tk_msg.rpc_proc->p_proc == 0) { in call_bind_status()
2080 rpc_delay(task, 3*HZ); in call_bind_status()
2083 rpc_delay(task, HZ >> 2); in call_bind_status()
2088 trace_rpcb_timeout_err(task); in call_bind_status()
2092 trace_rpcb_bind_version_err(task); in call_bind_status()
2095 trace_rpcb_bind_version_err(task); in call_bind_status()
2106 trace_rpcb_unreachable_err(task); in call_bind_status()
2107 if (!RPC_IS_SOFTCONN(task)) { in call_bind_status()
2108 rpc_delay(task, 5*HZ); in call_bind_status()
2111 status = task->tk_status; in call_bind_status()
2114 trace_rpcb_unrecognized_err(task); in call_bind_status()
2117 rpc_call_rpcerror(task, status); in call_bind_status()
2120 task->tk_action = call_connect; in call_bind_status()
2123 task->tk_status = 0; in call_bind_status()
2124 task->tk_action = call_bind; in call_bind_status()
2125 rpc_check_timeout(task); in call_bind_status()
2132 call_connect(struct rpc_task *task) in call_connect() argument
2134 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect()
2136 if (rpc_task_transmitted(task)) { in call_connect()
2137 rpc_task_handle_transmitted(task); in call_connect()
2142 task->tk_action = call_transmit; in call_connect()
2146 task->tk_action = call_connect_status; in call_connect()
2147 if (task->tk_status < 0) in call_connect()
2149 if (task->tk_flags & RPC_TASK_NOCONNECT) { in call_connect()
2150 rpc_call_rpcerror(task, -ENOTCONN); in call_connect()
2153 if (!xprt_prepare_transmit(task)) in call_connect()
2155 xprt_connect(task); in call_connect()
2162 call_connect_status(struct rpc_task *task) in call_connect_status() argument
2164 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect_status()
2165 struct rpc_clnt *clnt = task->tk_client; in call_connect_status()
2166 int status = task->tk_status; in call_connect_status()
2168 if (rpc_task_transmitted(task)) { in call_connect_status()
2169 rpc_task_handle_transmitted(task); in call_connect_status()
2173 trace_rpc_connect_status(task); in call_connect_status()
2175 if (task->tk_status == 0) { in call_connect_status()
2180 task->tk_status = 0; in call_connect_status()
2184 task->tk_status = 0; in call_connect_status()
2189 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2202 xprt_conditional_disconnect(task->tk_rqstp->rq_xprt, in call_connect_status()
2203 task->tk_rqstp->rq_connect_cookie); in call_connect_status()
2204 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2207 rpc_delay(task, 3*HZ); in call_connect_status()
2213 if (!(task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) && in call_connect_status()
2214 (task->tk_flags & RPC_TASK_MOVEABLE) && in call_connect_status()
2216 struct rpc_xprt *saved = task->tk_xprt; in call_connect_status()
2223 xprt_release(task); in call_connect_status()
2229 task->tk_xprt = NULL; in call_connect_status()
2230 task->tk_action = call_start; in call_connect_status()
2233 if (!task->tk_xprt) in call_connect_status()
2238 rpc_delay(task, HZ >> 2); in call_connect_status()
2241 rpc_call_rpcerror(task, status); in call_connect_status()
2244 task->tk_action = call_transmit; in call_connect_status()
2248 task->tk_action = call_bind; in call_connect_status()
2250 rpc_check_timeout(task); in call_connect_status()
2257 call_transmit(struct rpc_task *task) in call_transmit() argument
2259 if (rpc_task_transmitted(task)) { in call_transmit()
2260 rpc_task_handle_transmitted(task); in call_transmit()
2264 task->tk_action = call_transmit_status; in call_transmit()
2265 if (!xprt_prepare_transmit(task)) in call_transmit()
2267 task->tk_status = 0; in call_transmit()
2268 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_transmit()
2269 if (!xprt_connected(task->tk_xprt)) { in call_transmit()
2270 task->tk_status = -ENOTCONN; in call_transmit()
2273 xprt_transmit(task); in call_transmit()
2275 xprt_end_transmit(task); in call_transmit()
2282 call_transmit_status(struct rpc_task *task) in call_transmit_status() argument
2284 task->tk_action = call_status; in call_transmit_status()
2290 if (rpc_task_transmitted(task)) { in call_transmit_status()
2291 task->tk_status = 0; in call_transmit_status()
2292 xprt_request_wait_receive(task); in call_transmit_status()
2296 switch (task->tk_status) { in call_transmit_status()
2300 task->tk_status = 0; in call_transmit_status()
2301 task->tk_action = call_encode; in call_transmit_status()
2311 rpc_delay(task, HZ>>2); in call_transmit_status()
2315 task->tk_action = call_transmit; in call_transmit_status()
2316 task->tk_status = 0; in call_transmit_status()
2325 if (RPC_IS_SOFTCONN(task)) { in call_transmit_status()
2326 if (!task->tk_msg.rpc_proc->p_proc) in call_transmit_status()
2327 trace_xprt_ping(task->tk_xprt, in call_transmit_status()
2328 task->tk_status); in call_transmit_status()
2329 rpc_call_rpcerror(task, task->tk_status); in call_transmit_status()
2338 task->tk_action = call_bind; in call_transmit_status()
2339 task->tk_status = 0; in call_transmit_status()
2342 rpc_check_timeout(task); in call_transmit_status()
2346 static void call_bc_transmit(struct rpc_task *task);
2347 static void call_bc_transmit_status(struct rpc_task *task);
2350 call_bc_encode(struct rpc_task *task) in call_bc_encode() argument
2352 xprt_request_enqueue_transmit(task); in call_bc_encode()
2353 task->tk_action = call_bc_transmit; in call_bc_encode()
2361 call_bc_transmit(struct rpc_task *task) in call_bc_transmit() argument
2363 task->tk_action = call_bc_transmit_status; in call_bc_transmit()
2364 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_bc_transmit()
2365 if (!xprt_prepare_transmit(task)) in call_bc_transmit()
2367 task->tk_status = 0; in call_bc_transmit()
2368 xprt_transmit(task); in call_bc_transmit()
2370 xprt_end_transmit(task); in call_bc_transmit()
2374 call_bc_transmit_status(struct rpc_task *task) in call_bc_transmit_status() argument
2376 struct rpc_rqst *req = task->tk_rqstp; in call_bc_transmit_status()
2378 if (rpc_task_transmitted(task)) in call_bc_transmit_status()
2379 task->tk_status = 0; in call_bc_transmit_status()
2381 switch (task->tk_status) { in call_bc_transmit_status()
2396 rpc_delay(task, HZ>>2); in call_bc_transmit_status()
2400 task->tk_status = 0; in call_bc_transmit_status()
2401 task->tk_action = call_bc_transmit; in call_bc_transmit_status()
2412 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2422 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2425 task->tk_action = rpc_exit_task; in call_bc_transmit_status()
2433 call_status(struct rpc_task *task) in call_status() argument
2435 struct rpc_clnt *clnt = task->tk_client; in call_status()
2438 if (!task->tk_msg.rpc_proc->p_proc) in call_status()
2439 trace_xprt_ping(task->tk_xprt, task->tk_status); in call_status()
2441 status = task->tk_status; in call_status()
2443 task->tk_action = call_decode; in call_status()
2447 trace_rpc_call_status(task); in call_status()
2448 task->tk_status = 0; in call_status()
2455 if (RPC_IS_SOFTCONN(task)) in call_status()
2461 rpc_delay(task, 3*HZ); in call_status()
2472 rpc_delay(task, 3*HZ); in call_status()
2480 rpc_delay(task, HZ>>2); in call_status()
2491 task->tk_action = call_encode; in call_status()
2492 rpc_check_timeout(task); in call_status()
2495 rpc_call_rpcerror(task, status); in call_status()
2508 rpc_check_timeout(struct rpc_task *task) in rpc_check_timeout() argument
2510 struct rpc_clnt *clnt = task->tk_client; in rpc_check_timeout()
2512 if (RPC_SIGNALLED(task)) in rpc_check_timeout()
2515 if (xprt_adjust_timeout(task->tk_rqstp) == 0) in rpc_check_timeout()
2518 trace_rpc_timeout_status(task); in rpc_check_timeout()
2519 task->tk_timeouts++; in rpc_check_timeout()
2521 if (RPC_IS_SOFTCONN(task) && !rpc_check_connected(task->tk_rqstp)) { in rpc_check_timeout()
2522 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2526 if (RPC_IS_SOFT(task)) { in rpc_check_timeout()
2532 if ((task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) && in rpc_check_timeout()
2533 rpc_check_connected(task->tk_rqstp)) in rpc_check_timeout()
2540 task->tk_xprt->servername); in rpc_check_timeout()
2542 if (task->tk_flags & RPC_TASK_TIMEOUT) in rpc_check_timeout()
2543 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2545 __rpc_call_rpcerror(task, -EIO, -ETIMEDOUT); in rpc_check_timeout()
2549 if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) { in rpc_check_timeout()
2550 task->tk_flags |= RPC_CALL_MAJORSEEN; in rpc_check_timeout()
2555 task->tk_xprt->servername); in rpc_check_timeout()
2563 rpcauth_invalcred(task); in rpc_check_timeout()
2570 call_decode(struct rpc_task *task) in call_decode() argument
2572 struct rpc_clnt *clnt = task->tk_client; in call_decode()
2573 struct rpc_rqst *req = task->tk_rqstp; in call_decode()
2577 if (!task->tk_msg.rpc_proc->p_decode) { in call_decode()
2578 task->tk_action = rpc_exit_task; in call_decode()
2582 if (task->tk_flags & RPC_CALL_MAJORSEEN) { in call_decode()
2586 task->tk_xprt->servername); in call_decode()
2588 task->tk_flags &= ~RPC_CALL_MAJORSEEN; in call_decode()
2605 trace_rpc_xdr_recvfrom(task, &req->rq_rcv_buf); in call_decode()
2613 err = rpc_decode_header(task, &xdr); in call_decode()
2617 task->tk_action = rpc_exit_task; in call_decode()
2618 task->tk_status = rpcauth_unwrap_resp(task, &xdr); in call_decode()
2622 task->tk_status = 0; in call_decode()
2623 if (task->tk_client->cl_discrtry) in call_decode()
2626 task->tk_action = call_encode; in call_decode()
2627 rpc_check_timeout(task); in call_decode()
2630 task->tk_action = call_reserve; in call_decode()
2631 rpc_check_timeout(task); in call_decode()
2632 rpcauth_invalcred(task); in call_decode()
2634 xprt_release(task); in call_decode()
2639 rpc_encode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_encode_header() argument
2641 struct rpc_clnt *clnt = task->tk_client; in rpc_encode_header()
2642 struct rpc_rqst *req = task->tk_rqstp; in rpc_encode_header()
2655 *p = cpu_to_be32(task->tk_msg.rpc_proc->p_proc); in rpc_encode_header()
2657 error = rpcauth_marshcred(task, xdr); in rpc_encode_header()
2662 trace_rpc_bad_callhdr(task); in rpc_encode_header()
2663 rpc_call_rpcerror(task, error); in rpc_encode_header()
2668 rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_decode_header() argument
2670 struct rpc_clnt *clnt = task->tk_client; in rpc_decode_header()
2679 if (task->tk_rqstp->rq_rcv_buf.len & 3) in rpc_decode_header()
2691 error = rpcauth_checkverf(task, xdr); in rpc_decode_header()
2693 struct rpc_cred *cred = task->tk_rqstp->rq_cred; in rpc_decode_header()
2696 rpcauth_invalcred(task); in rpc_decode_header()
2697 if (!task->tk_cred_retry) in rpc_decode_header()
2699 task->tk_cred_retry--; in rpc_decode_header()
2700 trace_rpc__stale_creds(task); in rpc_decode_header()
2713 trace_rpc__prog_unavail(task); in rpc_decode_header()
2717 trace_rpc__prog_mismatch(task); in rpc_decode_header()
2721 trace_rpc__proc_unavail(task); in rpc_decode_header()
2726 trace_rpc__garbage_args(task); in rpc_decode_header()
2735 if (task->tk_garb_retry) { in rpc_decode_header()
2736 task->tk_garb_retry--; in rpc_decode_header()
2737 task->tk_action = call_encode; in rpc_decode_header()
2741 rpc_call_rpcerror(task, error); in rpc_decode_header()
2745 trace_rpc__unparsable(task); in rpc_decode_header()
2750 trace_rpc_bad_verifier(task); in rpc_decode_header()
2770 trace_rpc__mismatch(task); in rpc_decode_header()
2785 rpcauth_invalcred(task); in rpc_decode_header()
2786 if (!task->tk_cred_retry) in rpc_decode_header()
2788 task->tk_cred_retry--; in rpc_decode_header()
2789 trace_rpc__stale_creds(task); in rpc_decode_header()
2794 if (!task->tk_garb_retry) in rpc_decode_header()
2796 task->tk_garb_retry--; in rpc_decode_header()
2797 trace_rpc__bad_creds(task); in rpc_decode_header()
2798 task->tk_action = call_encode; in rpc_decode_header()
2801 trace_rpc__auth_tooweak(task); in rpc_decode_header()
2803 task->tk_xprt->servername); in rpc_decode_header()
2832 rpc_null_call_prepare(struct rpc_task *task, void *data) in rpc_null_call_prepare() argument
2834 task->tk_flags &= ~RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_null_call_prepare()
2835 rpc_call_start(task); in rpc_null_call_prepare()
2873 struct rpc_task *task; in rpc_ping() local
2879 task = rpc_call_null_helper(clnt, NULL, NULL, 0, NULL, NULL); in rpc_ping()
2880 if (IS_ERR(task)) in rpc_ping()
2881 return PTR_ERR(task); in rpc_ping()
2882 status = task->tk_status; in rpc_ping()
2883 rpc_put_task(task); in rpc_ping()
2898 struct rpc_task *task; in rpc_ping_noreply() local
2901 task = rpc_run_task(&task_setup_data); in rpc_ping_noreply()
2902 if (IS_ERR(task)) in rpc_ping_noreply()
2903 return PTR_ERR(task); in rpc_ping_noreply()
2904 status = task->tk_status; in rpc_ping_noreply()
2905 rpc_put_task(task); in rpc_ping_noreply()
2914 static void rpc_cb_add_xprt_done(struct rpc_task *task, void *calldata) in rpc_cb_add_xprt_done() argument
2918 if (task->tk_status == 0) in rpc_cb_add_xprt_done()
2949 struct rpc_task *task; in rpc_clnt_test_and_add_xprt() local
2973 task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_ASYNC, in rpc_clnt_test_and_add_xprt()
2975 if (IS_ERR(task)) in rpc_clnt_test_and_add_xprt()
2976 return PTR_ERR(task); in rpc_clnt_test_and_add_xprt()
2979 rpc_put_task(task); in rpc_clnt_test_and_add_xprt()
2989 struct rpc_task *task; in rpc_clnt_add_xprt_helper() local
2993 task = rpc_call_null_helper(clnt, xprt, NULL, 0, NULL, NULL); in rpc_clnt_add_xprt_helper()
2994 if (IS_ERR(task)) in rpc_clnt_add_xprt_helper()
2995 return PTR_ERR(task); in rpc_clnt_add_xprt_helper()
2997 status = task->tk_status; in rpc_clnt_add_xprt_helper()
2998 rpc_put_task(task); in rpc_clnt_add_xprt_helper()
3329 const struct rpc_task *task) in rpc_show_task() argument
3333 if (RPC_IS_QUEUED(task)) in rpc_show_task()
3334 rpc_waitq = rpc_qname(task->tk_waitqueue); in rpc_show_task()
3337 task->tk_pid, task->tk_flags, task->tk_status, in rpc_show_task()
3338 clnt, task->tk_rqstp, rpc_task_timeout(task), task->tk_ops, in rpc_show_task()
3339 clnt->cl_program->name, clnt->cl_vers, rpc_proc_name(task), in rpc_show_task()
3340 task->tk_action, rpc_waitq); in rpc_show_task()
3346 struct rpc_task *task; in rpc_show_tasks() local
3353 list_for_each_entry(task, &clnt->cl_tasks, tk_task) { in rpc_show_tasks()
3358 rpc_show_task(clnt, task); in rpc_show_tasks()