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,
80 static void rpc_check_timeout(struct rpc_task *task);
905 struct rpc_task *task; in rpc_cancel_tasks() local
914 list_for_each_entry(task, &clnt->cl_tasks, tk_task) { in rpc_cancel_tasks()
915 if (!RPC_IS_ACTIVATED(task)) in rpc_cancel_tasks()
917 if (!fnmatch(task, data)) in rpc_cancel_tasks()
919 rpc_task_try_cancel(task, error); in rpc_cancel_tasks()
1107 void rpc_task_release_transport(struct rpc_task *task) in rpc_task_release_transport() argument
1109 struct rpc_xprt *xprt = task->tk_xprt; in rpc_task_release_transport()
1112 task->tk_xprt = NULL; in rpc_task_release_transport()
1113 if (task->tk_client) in rpc_task_release_transport()
1114 rpc_task_release_xprt(task->tk_client, xprt); in rpc_task_release_transport()
1121 void rpc_task_release_client(struct rpc_task *task) in rpc_task_release_client() argument
1123 struct rpc_clnt *clnt = task->tk_client; in rpc_task_release_client()
1125 rpc_task_release_transport(task); in rpc_task_release_client()
1129 list_del(&task->tk_task); in rpc_task_release_client()
1131 task->tk_client = NULL; in rpc_task_release_client()
1155 void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_transport() argument
1157 if (task->tk_xprt) { in rpc_task_set_transport()
1158 if (!(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) && in rpc_task_set_transport()
1159 (task->tk_flags & RPC_TASK_MOVEABLE))) in rpc_task_set_transport()
1161 xprt_release(task); in rpc_task_set_transport()
1162 xprt_put(task->tk_xprt); in rpc_task_set_transport()
1164 if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) in rpc_task_set_transport()
1165 task->tk_xprt = rpc_task_get_first_xprt(clnt); in rpc_task_set_transport()
1167 task->tk_xprt = rpc_task_get_next_xprt(clnt); in rpc_task_set_transport()
1171 void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_client() argument
1173 rpc_task_set_transport(task, clnt); in rpc_task_set_client()
1174 task->tk_client = clnt; in rpc_task_set_client()
1177 task->tk_flags |= RPC_TASK_SOFT; in rpc_task_set_client()
1179 task->tk_flags |= RPC_TASK_TIMEOUT; in rpc_task_set_client()
1181 task->tk_flags |= RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_task_set_client()
1184 list_add_tail(&task->tk_task, &clnt->cl_tasks); in rpc_task_set_client()
1189 rpc_task_set_rpc_message(struct rpc_task *task, const struct rpc_message *msg) in rpc_task_set_rpc_message() argument
1192 task->tk_msg.rpc_proc = msg->rpc_proc; in rpc_task_set_rpc_message()
1193 task->tk_msg.rpc_argp = msg->rpc_argp; in rpc_task_set_rpc_message()
1194 task->tk_msg.rpc_resp = msg->rpc_resp; in rpc_task_set_rpc_message()
1195 task->tk_msg.rpc_cred = msg->rpc_cred; in rpc_task_set_rpc_message()
1196 if (!(task->tk_flags & RPC_TASK_CRED_NOREF)) in rpc_task_set_rpc_message()
1197 get_cred(task->tk_msg.rpc_cred); in rpc_task_set_rpc_message()
1205 rpc_default_callback(struct rpc_task *task, void *data) in rpc_default_callback() argument
1219 struct rpc_task *task; in rpc_run_task() local
1221 task = rpc_new_task(task_setup_data); in rpc_run_task()
1222 if (IS_ERR(task)) in rpc_run_task()
1223 return task; in rpc_run_task()
1225 if (!RPC_IS_ASYNC(task)) in rpc_run_task()
1226 task->tk_flags |= RPC_TASK_CRED_NOREF; in rpc_run_task()
1228 rpc_task_set_client(task, task_setup_data->rpc_client); in rpc_run_task()
1229 rpc_task_set_rpc_message(task, task_setup_data->rpc_message); in rpc_run_task()
1231 if (task->tk_action == NULL) in rpc_run_task()
1232 rpc_call_start(task); in rpc_run_task()
1234 atomic_inc(&task->tk_count); in rpc_run_task()
1235 rpc_execute(task); in rpc_run_task()
1236 return task; in rpc_run_task()
1248 struct rpc_task *task; in rpc_call_sync() local
1264 task = rpc_run_task(&task_setup_data); in rpc_call_sync()
1265 if (IS_ERR(task)) in rpc_call_sync()
1266 return PTR_ERR(task); in rpc_call_sync()
1267 status = task->tk_status; in rpc_call_sync()
1268 rpc_put_task(task); in rpc_call_sync()
1285 struct rpc_task *task; in rpc_call_async() local
1294 task = rpc_run_task(&task_setup_data); in rpc_call_async()
1295 if (IS_ERR(task)) in rpc_call_async()
1296 return PTR_ERR(task); in rpc_call_async()
1297 rpc_put_task(task); in rpc_call_async()
1303 static void call_bc_encode(struct rpc_task *task);
1312 struct rpc_task *task; in rpc_run_bc_task() local
1323 task = rpc_new_task(&task_setup_data); in rpc_run_bc_task()
1324 if (IS_ERR(task)) { in rpc_run_bc_task()
1326 return task; in rpc_run_bc_task()
1329 xprt_init_bc_request(req, task); in rpc_run_bc_task()
1331 task->tk_action = call_bc_encode; in rpc_run_bc_task()
1332 atomic_inc(&task->tk_count); in rpc_run_bc_task()
1333 WARN_ON_ONCE(atomic_read(&task->tk_count) != 2); in rpc_run_bc_task()
1334 rpc_execute(task); in rpc_run_bc_task()
1336 dprintk("RPC: rpc_run_bc_task: task= %p\n", task); in rpc_run_bc_task()
1337 return task; in rpc_run_bc_task()
1362 rpc_call_start(struct rpc_task *task) in rpc_call_start() argument
1364 task->tk_action = call_start; in rpc_call_start()
1662 __rpc_restart_call(struct rpc_task *task, void (*action)(struct rpc_task *)) in __rpc_restart_call() argument
1664 task->tk_status = 0; in __rpc_restart_call()
1665 task->tk_rpc_status = 0; in __rpc_restart_call()
1666 task->tk_action = action; in __rpc_restart_call()
1675 rpc_restart_call(struct rpc_task *task) in rpc_restart_call() argument
1677 return __rpc_restart_call(task, call_start); in rpc_restart_call()
1686 rpc_restart_call_prepare(struct rpc_task *task) in rpc_restart_call_prepare() argument
1688 if (task->tk_ops->rpc_call_prepare != NULL) in rpc_restart_call_prepare()
1689 return __rpc_restart_call(task, rpc_prepare_task); in rpc_restart_call_prepare()
1690 return rpc_restart_call(task); in rpc_restart_call_prepare()
1695 *rpc_proc_name(const struct rpc_task *task) in rpc_proc_name() argument
1697 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in rpc_proc_name()
1709 __rpc_call_rpcerror(struct rpc_task *task, int tk_status, int rpc_status) in __rpc_call_rpcerror() argument
1711 trace_rpc_call_rpcerror(task, tk_status, rpc_status); in __rpc_call_rpcerror()
1712 rpc_task_set_rpc_status(task, rpc_status); in __rpc_call_rpcerror()
1713 rpc_exit(task, tk_status); in __rpc_call_rpcerror()
1717 rpc_call_rpcerror(struct rpc_task *task, int status) in rpc_call_rpcerror() argument
1719 __rpc_call_rpcerror(task, status, status); in rpc_call_rpcerror()
1729 call_start(struct rpc_task *task) in call_start() argument
1731 struct rpc_clnt *clnt = task->tk_client; in call_start()
1732 int idx = task->tk_msg.rpc_proc->p_statidx; in call_start()
1734 trace_rpc_request(task); in call_start()
1736 if (task->tk_client->cl_shutdown) { in call_start()
1737 rpc_call_rpcerror(task, -EIO); in call_start()
1745 task->tk_action = call_reserve; in call_start()
1746 rpc_task_set_transport(task, clnt); in call_start()
1753 call_reserve(struct rpc_task *task) in call_reserve() argument
1755 task->tk_status = 0; in call_reserve()
1756 task->tk_action = call_reserveresult; in call_reserve()
1757 xprt_reserve(task); in call_reserve()
1760 static void call_retry_reserve(struct rpc_task *task);
1766 call_reserveresult(struct rpc_task *task) in call_reserveresult() argument
1768 int status = task->tk_status; in call_reserveresult()
1774 task->tk_status = 0; in call_reserveresult()
1776 if (task->tk_rqstp) { in call_reserveresult()
1777 task->tk_action = call_refresh; in call_reserveresult()
1781 rpc_call_rpcerror(task, -EIO); in call_reserveresult()
1787 rpc_delay(task, HZ >> 2); in call_reserveresult()
1790 task->tk_action = call_retry_reserve; in call_reserveresult()
1793 rpc_call_rpcerror(task, status); in call_reserveresult()
1801 call_retry_reserve(struct rpc_task *task) in call_retry_reserve() argument
1803 task->tk_status = 0; in call_retry_reserve()
1804 task->tk_action = call_reserveresult; in call_retry_reserve()
1805 xprt_retry_reserve(task); in call_retry_reserve()
1812 call_refresh(struct rpc_task *task) in call_refresh() argument
1814 task->tk_action = call_refreshresult; in call_refresh()
1815 task->tk_status = 0; in call_refresh()
1816 task->tk_client->cl_stats->rpcauthrefresh++; in call_refresh()
1817 rpcauth_refreshcred(task); in call_refresh()
1824 call_refreshresult(struct rpc_task *task) in call_refreshresult() argument
1826 int status = task->tk_status; in call_refreshresult()
1828 task->tk_status = 0; in call_refreshresult()
1829 task->tk_action = call_refresh; in call_refreshresult()
1832 if (rpcauth_uptodatecred(task)) { in call_refreshresult()
1833 task->tk_action = call_allocate; in call_refreshresult()
1841 rpc_delay(task, 3*HZ); in call_refreshresult()
1847 if (!task->tk_cred_retry) in call_refreshresult()
1849 task->tk_cred_retry--; in call_refreshresult()
1850 trace_rpc_retry_refresh_status(task); in call_refreshresult()
1853 rpc_delay(task, HZ >> 4); in call_refreshresult()
1856 trace_rpc_refresh_status(task); in call_refreshresult()
1857 rpc_call_rpcerror(task, status); in call_refreshresult()
1865 call_allocate(struct rpc_task *task) in call_allocate() argument
1867 const struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth; in call_allocate()
1868 struct rpc_rqst *req = task->tk_rqstp; in call_allocate()
1870 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in call_allocate()
1873 task->tk_status = 0; in call_allocate()
1874 task->tk_action = call_encode; in call_allocate()
1901 status = xprt->ops->buf_alloc(task); in call_allocate()
1902 trace_rpc_buf_alloc(task, status); in call_allocate()
1906 rpc_call_rpcerror(task, status); in call_allocate()
1910 if (RPC_IS_ASYNC(task) || !fatal_signal_pending(current)) { in call_allocate()
1911 task->tk_action = call_allocate; in call_allocate()
1912 rpc_delay(task, HZ>>4); in call_allocate()
1916 rpc_call_rpcerror(task, -ERESTARTSYS); in call_allocate()
1920 rpc_task_need_encode(struct rpc_task *task) in rpc_task_need_encode() argument
1922 return test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate) == 0 && in rpc_task_need_encode()
1923 (!(task->tk_flags & RPC_TASK_SENT) || in rpc_task_need_encode()
1924 !(task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) || in rpc_task_need_encode()
1925 xprt_request_need_retransmit(task)); in rpc_task_need_encode()
1929 rpc_xdr_encode(struct rpc_task *task) in rpc_xdr_encode() argument
1931 struct rpc_rqst *req = task->tk_rqstp; in rpc_xdr_encode()
1945 if (rpc_encode_header(task, &xdr)) in rpc_xdr_encode()
1948 task->tk_status = rpcauth_wrap_req(task, &xdr); in rpc_xdr_encode()
1955 call_encode(struct rpc_task *task) in call_encode() argument
1957 if (!rpc_task_need_encode(task)) in call_encode()
1961 xprt_request_dequeue_xprt(task); in call_encode()
1963 rpc_xdr_encode(task); in call_encode()
1965 if (task->tk_status == 0 && rpc_reply_expected(task)) in call_encode()
1966 task->tk_status = xprt_request_enqueue_receive(task); in call_encode()
1968 if (task->tk_status != 0) { in call_encode()
1970 switch (task->tk_status) { in call_encode()
1973 rpc_delay(task, HZ >> 4); in call_encode()
1976 if (!task->tk_cred_retry) { in call_encode()
1977 rpc_call_rpcerror(task, task->tk_status); in call_encode()
1979 task->tk_action = call_refresh; in call_encode()
1980 task->tk_cred_retry--; in call_encode()
1981 trace_rpc_retry_refresh_status(task); in call_encode()
1985 rpc_call_rpcerror(task, task->tk_status); in call_encode()
1990 xprt_request_enqueue_transmit(task); in call_encode()
1992 task->tk_action = call_transmit; in call_encode()
1994 if (!xprt_bound(task->tk_xprt)) in call_encode()
1995 task->tk_action = call_bind; in call_encode()
1996 else if (!xprt_connected(task->tk_xprt)) in call_encode()
1997 task->tk_action = call_connect; in call_encode()
2005 rpc_task_transmitted(struct rpc_task *task) in rpc_task_transmitted() argument
2007 return !test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate); in rpc_task_transmitted()
2011 rpc_task_handle_transmitted(struct rpc_task *task) in rpc_task_handle_transmitted() argument
2013 xprt_end_transmit(task); in rpc_task_handle_transmitted()
2014 task->tk_action = call_transmit_status; in rpc_task_handle_transmitted()
2021 call_bind(struct rpc_task *task) in call_bind() argument
2023 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind()
2025 if (rpc_task_transmitted(task)) { in call_bind()
2026 rpc_task_handle_transmitted(task); in call_bind()
2031 task->tk_action = call_connect; in call_bind()
2035 task->tk_action = call_bind_status; in call_bind()
2036 if (!xprt_prepare_transmit(task)) in call_bind()
2039 xprt->ops->rpcbind(task); in call_bind()
2046 call_bind_status(struct rpc_task *task) in call_bind_status() argument
2048 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind_status()
2051 if (rpc_task_transmitted(task)) { in call_bind_status()
2052 rpc_task_handle_transmitted(task); in call_bind_status()
2056 if (task->tk_status >= 0) in call_bind_status()
2059 task->tk_status = 0; in call_bind_status()
2063 switch (task->tk_status) { in call_bind_status()
2065 rpc_delay(task, HZ >> 2); in call_bind_status()
2068 trace_rpcb_prog_unavail_err(task); in call_bind_status()
2070 if (task->tk_msg.rpc_proc->p_proc == 0) { in call_bind_status()
2074 rpc_delay(task, 3*HZ); in call_bind_status()
2077 rpc_delay(task, HZ >> 2); in call_bind_status()
2082 trace_rpcb_timeout_err(task); in call_bind_status()
2086 trace_rpcb_bind_version_err(task); in call_bind_status()
2089 trace_rpcb_bind_version_err(task); in call_bind_status()
2100 trace_rpcb_unreachable_err(task); in call_bind_status()
2101 if (!RPC_IS_SOFTCONN(task)) { in call_bind_status()
2102 rpc_delay(task, 5*HZ); in call_bind_status()
2105 status = task->tk_status; in call_bind_status()
2108 trace_rpcb_unrecognized_err(task); in call_bind_status()
2111 rpc_call_rpcerror(task, status); in call_bind_status()
2114 task->tk_action = call_connect; in call_bind_status()
2117 task->tk_status = 0; in call_bind_status()
2118 task->tk_action = call_bind; in call_bind_status()
2119 rpc_check_timeout(task); in call_bind_status()
2126 call_connect(struct rpc_task *task) in call_connect() argument
2128 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect()
2130 if (rpc_task_transmitted(task)) { in call_connect()
2131 rpc_task_handle_transmitted(task); in call_connect()
2136 task->tk_action = call_transmit; in call_connect()
2140 task->tk_action = call_connect_status; in call_connect()
2141 if (task->tk_status < 0) in call_connect()
2143 if (task->tk_flags & RPC_TASK_NOCONNECT) { in call_connect()
2144 rpc_call_rpcerror(task, -ENOTCONN); in call_connect()
2147 if (!xprt_prepare_transmit(task)) in call_connect()
2149 xprt_connect(task); in call_connect()
2156 call_connect_status(struct rpc_task *task) in call_connect_status() argument
2158 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect_status()
2159 struct rpc_clnt *clnt = task->tk_client; in call_connect_status()
2160 int status = task->tk_status; in call_connect_status()
2162 if (rpc_task_transmitted(task)) { in call_connect_status()
2163 rpc_task_handle_transmitted(task); in call_connect_status()
2167 trace_rpc_connect_status(task); in call_connect_status()
2169 if (task->tk_status == 0) { in call_connect_status()
2174 task->tk_status = 0; in call_connect_status()
2178 task->tk_status = 0; in call_connect_status()
2183 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2196 xprt_conditional_disconnect(task->tk_rqstp->rq_xprt, in call_connect_status()
2197 task->tk_rqstp->rq_connect_cookie); in call_connect_status()
2198 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2201 rpc_delay(task, 3*HZ); in call_connect_status()
2207 if (!(task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) && in call_connect_status()
2208 (task->tk_flags & RPC_TASK_MOVEABLE) && in call_connect_status()
2210 struct rpc_xprt *saved = task->tk_xprt; in call_connect_status()
2219 xprt_release(task); in call_connect_status()
2225 task->tk_xprt = NULL; in call_connect_status()
2226 task->tk_action = call_start; in call_connect_status()
2229 if (!task->tk_xprt) in call_connect_status()
2234 rpc_delay(task, HZ >> 2); in call_connect_status()
2237 rpc_call_rpcerror(task, status); in call_connect_status()
2240 task->tk_action = call_transmit; in call_connect_status()
2244 task->tk_action = call_bind; in call_connect_status()
2245 rpc_check_timeout(task); in call_connect_status()
2252 call_transmit(struct rpc_task *task) in call_transmit() argument
2254 if (rpc_task_transmitted(task)) { in call_transmit()
2255 rpc_task_handle_transmitted(task); in call_transmit()
2259 task->tk_action = call_transmit_status; in call_transmit()
2260 if (!xprt_prepare_transmit(task)) in call_transmit()
2262 task->tk_status = 0; in call_transmit()
2263 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_transmit()
2264 if (!xprt_connected(task->tk_xprt)) { in call_transmit()
2265 task->tk_status = -ENOTCONN; in call_transmit()
2268 xprt_transmit(task); in call_transmit()
2270 xprt_end_transmit(task); in call_transmit()
2277 call_transmit_status(struct rpc_task *task) in call_transmit_status() argument
2279 task->tk_action = call_status; in call_transmit_status()
2285 if (rpc_task_transmitted(task)) { in call_transmit_status()
2286 task->tk_status = 0; in call_transmit_status()
2287 xprt_request_wait_receive(task); in call_transmit_status()
2291 switch (task->tk_status) { in call_transmit_status()
2295 task->tk_status = 0; in call_transmit_status()
2296 task->tk_action = call_encode; in call_transmit_status()
2306 rpc_delay(task, HZ>>2); in call_transmit_status()
2310 task->tk_action = call_transmit; in call_transmit_status()
2311 task->tk_status = 0; in call_transmit_status()
2320 if (RPC_IS_SOFTCONN(task)) { in call_transmit_status()
2321 if (!task->tk_msg.rpc_proc->p_proc) in call_transmit_status()
2322 trace_xprt_ping(task->tk_xprt, in call_transmit_status()
2323 task->tk_status); in call_transmit_status()
2324 rpc_call_rpcerror(task, task->tk_status); in call_transmit_status()
2333 task->tk_action = call_bind; in call_transmit_status()
2334 task->tk_status = 0; in call_transmit_status()
2337 rpc_check_timeout(task); in call_transmit_status()
2341 static void call_bc_transmit(struct rpc_task *task);
2342 static void call_bc_transmit_status(struct rpc_task *task);
2345 call_bc_encode(struct rpc_task *task) in call_bc_encode() argument
2347 xprt_request_enqueue_transmit(task); in call_bc_encode()
2348 task->tk_action = call_bc_transmit; in call_bc_encode()
2356 call_bc_transmit(struct rpc_task *task) in call_bc_transmit() argument
2358 task->tk_action = call_bc_transmit_status; in call_bc_transmit()
2359 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_bc_transmit()
2360 if (!xprt_prepare_transmit(task)) in call_bc_transmit()
2362 task->tk_status = 0; in call_bc_transmit()
2363 xprt_transmit(task); in call_bc_transmit()
2365 xprt_end_transmit(task); in call_bc_transmit()
2369 call_bc_transmit_status(struct rpc_task *task) in call_bc_transmit_status() argument
2371 struct rpc_rqst *req = task->tk_rqstp; in call_bc_transmit_status()
2373 if (rpc_task_transmitted(task)) in call_bc_transmit_status()
2374 task->tk_status = 0; in call_bc_transmit_status()
2376 switch (task->tk_status) { in call_bc_transmit_status()
2391 rpc_delay(task, HZ>>2); in call_bc_transmit_status()
2395 task->tk_status = 0; in call_bc_transmit_status()
2396 task->tk_action = call_bc_transmit; in call_bc_transmit_status()
2407 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2417 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2420 task->tk_action = rpc_exit_task; in call_bc_transmit_status()
2428 call_status(struct rpc_task *task) in call_status() argument
2430 struct rpc_clnt *clnt = task->tk_client; in call_status()
2433 if (!task->tk_msg.rpc_proc->p_proc) in call_status()
2434 trace_xprt_ping(task->tk_xprt, task->tk_status); in call_status()
2436 status = task->tk_status; in call_status()
2438 task->tk_action = call_decode; in call_status()
2442 trace_rpc_call_status(task); in call_status()
2443 task->tk_status = 0; in call_status()
2450 if (RPC_IS_SOFTCONN(task)) in call_status()
2456 rpc_delay(task, 3*HZ); in call_status()
2467 rpc_delay(task, 3*HZ); in call_status()
2475 rpc_delay(task, HZ>>2); in call_status()
2486 task->tk_action = call_encode; in call_status()
2487 rpc_check_timeout(task); in call_status()
2490 rpc_call_rpcerror(task, status); in call_status()
2503 rpc_check_timeout(struct rpc_task *task) in rpc_check_timeout() argument
2505 struct rpc_clnt *clnt = task->tk_client; in rpc_check_timeout()
2507 if (RPC_SIGNALLED(task)) in rpc_check_timeout()
2510 if (xprt_adjust_timeout(task->tk_rqstp) == 0) in rpc_check_timeout()
2513 trace_rpc_timeout_status(task); in rpc_check_timeout()
2514 task->tk_timeouts++; in rpc_check_timeout()
2516 if (RPC_IS_SOFTCONN(task) && !rpc_check_connected(task->tk_rqstp)) { in rpc_check_timeout()
2517 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2521 if (RPC_IS_SOFT(task)) { in rpc_check_timeout()
2527 if ((task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) && in rpc_check_timeout()
2528 rpc_check_connected(task->tk_rqstp)) in rpc_check_timeout()
2535 task->tk_xprt->servername); in rpc_check_timeout()
2537 if (task->tk_flags & RPC_TASK_TIMEOUT) in rpc_check_timeout()
2538 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2540 __rpc_call_rpcerror(task, -EIO, -ETIMEDOUT); in rpc_check_timeout()
2544 if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) { in rpc_check_timeout()
2545 task->tk_flags |= RPC_CALL_MAJORSEEN; in rpc_check_timeout()
2550 task->tk_xprt->servername); in rpc_check_timeout()
2558 rpcauth_invalcred(task); in rpc_check_timeout()
2565 call_decode(struct rpc_task *task) in call_decode() argument
2567 struct rpc_clnt *clnt = task->tk_client; in call_decode()
2568 struct rpc_rqst *req = task->tk_rqstp; in call_decode()
2572 if (!task->tk_msg.rpc_proc->p_decode) { in call_decode()
2573 task->tk_action = rpc_exit_task; in call_decode()
2577 if (task->tk_flags & RPC_CALL_MAJORSEEN) { in call_decode()
2581 task->tk_xprt->servername); in call_decode()
2583 task->tk_flags &= ~RPC_CALL_MAJORSEEN; in call_decode()
2600 trace_rpc_xdr_recvfrom(task, &req->rq_rcv_buf); in call_decode()
2608 err = rpc_decode_header(task, &xdr); in call_decode()
2612 task->tk_action = rpc_exit_task; in call_decode()
2613 task->tk_status = rpcauth_unwrap_resp(task, &xdr); in call_decode()
2617 task->tk_status = 0; in call_decode()
2618 if (task->tk_client->cl_discrtry) in call_decode()
2621 task->tk_action = call_encode; in call_decode()
2622 rpc_check_timeout(task); in call_decode()
2625 task->tk_action = call_reserve; in call_decode()
2626 rpc_check_timeout(task); in call_decode()
2627 rpcauth_invalcred(task); in call_decode()
2629 xprt_release(task); in call_decode()
2634 rpc_encode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_encode_header() argument
2636 struct rpc_clnt *clnt = task->tk_client; in rpc_encode_header()
2637 struct rpc_rqst *req = task->tk_rqstp; in rpc_encode_header()
2650 *p = cpu_to_be32(task->tk_msg.rpc_proc->p_proc); in rpc_encode_header()
2652 error = rpcauth_marshcred(task, xdr); in rpc_encode_header()
2657 trace_rpc_bad_callhdr(task); in rpc_encode_header()
2658 rpc_call_rpcerror(task, error); in rpc_encode_header()
2663 rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_decode_header() argument
2665 struct rpc_clnt *clnt = task->tk_client; in rpc_decode_header()
2674 if (task->tk_rqstp->rq_rcv_buf.len & 3) in rpc_decode_header()
2686 error = rpcauth_checkverf(task, xdr); in rpc_decode_header()
2697 trace_rpc__prog_unavail(task); in rpc_decode_header()
2701 trace_rpc__prog_mismatch(task); in rpc_decode_header()
2705 trace_rpc__proc_unavail(task); in rpc_decode_header()
2710 trace_rpc__garbage_args(task); in rpc_decode_header()
2719 if (task->tk_garb_retry) { in rpc_decode_header()
2720 task->tk_garb_retry--; in rpc_decode_header()
2721 task->tk_action = call_encode; in rpc_decode_header()
2725 rpc_call_rpcerror(task, error); in rpc_decode_header()
2729 trace_rpc__unparsable(task); in rpc_decode_header()
2734 trace_rpc_bad_verifier(task); in rpc_decode_header()
2754 trace_rpc__mismatch(task); in rpc_decode_header()
2769 rpcauth_invalcred(task); in rpc_decode_header()
2770 if (!task->tk_cred_retry) in rpc_decode_header()
2772 task->tk_cred_retry--; in rpc_decode_header()
2773 trace_rpc__stale_creds(task); in rpc_decode_header()
2778 if (!task->tk_garb_retry) in rpc_decode_header()
2780 task->tk_garb_retry--; in rpc_decode_header()
2781 trace_rpc__bad_creds(task); in rpc_decode_header()
2782 task->tk_action = call_encode; in rpc_decode_header()
2785 trace_rpc__auth_tooweak(task); in rpc_decode_header()
2787 task->tk_xprt->servername); in rpc_decode_header()
2816 rpc_null_call_prepare(struct rpc_task *task, void *data) in rpc_null_call_prepare() argument
2818 task->tk_flags &= ~RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_null_call_prepare()
2819 rpc_call_start(task); in rpc_null_call_prepare()
2857 struct rpc_task *task; in rpc_ping() local
2863 task = rpc_call_null_helper(clnt, NULL, NULL, 0, NULL, NULL); in rpc_ping()
2864 if (IS_ERR(task)) in rpc_ping()
2865 return PTR_ERR(task); in rpc_ping()
2866 status = task->tk_status; in rpc_ping()
2867 rpc_put_task(task); in rpc_ping()
2882 struct rpc_task *task; in rpc_ping_noreply() local
2885 task = rpc_run_task(&task_setup_data); in rpc_ping_noreply()
2886 if (IS_ERR(task)) in rpc_ping_noreply()
2887 return PTR_ERR(task); in rpc_ping_noreply()
2888 status = task->tk_status; in rpc_ping_noreply()
2889 rpc_put_task(task); in rpc_ping_noreply()
2898 static void rpc_cb_add_xprt_done(struct rpc_task *task, void *calldata) in rpc_cb_add_xprt_done() argument
2902 if (task->tk_status == 0) in rpc_cb_add_xprt_done()
2933 struct rpc_task *task; in rpc_clnt_test_and_add_xprt() local
2957 task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_ASYNC, in rpc_clnt_test_and_add_xprt()
2959 if (IS_ERR(task)) in rpc_clnt_test_and_add_xprt()
2960 return PTR_ERR(task); in rpc_clnt_test_and_add_xprt()
2963 rpc_put_task(task); in rpc_clnt_test_and_add_xprt()
2973 struct rpc_task *task; in rpc_clnt_add_xprt_helper() local
2977 task = rpc_call_null_helper(clnt, xprt, NULL, 0, NULL, NULL); in rpc_clnt_add_xprt_helper()
2978 if (IS_ERR(task)) in rpc_clnt_add_xprt_helper()
2979 return PTR_ERR(task); in rpc_clnt_add_xprt_helper()
2981 status = task->tk_status; in rpc_clnt_add_xprt_helper()
2982 rpc_put_task(task); in rpc_clnt_add_xprt_helper()
3323 const struct rpc_task *task) in rpc_show_task() argument
3327 if (RPC_IS_QUEUED(task)) in rpc_show_task()
3328 rpc_waitq = rpc_qname(task->tk_waitqueue); in rpc_show_task()
3331 task->tk_pid, task->tk_flags, task->tk_status, in rpc_show_task()
3332 clnt, task->tk_rqstp, rpc_task_timeout(task), task->tk_ops, in rpc_show_task()
3333 clnt->cl_program->name, clnt->cl_vers, rpc_proc_name(task), in rpc_show_task()
3334 task->tk_action, rpc_waitq); in rpc_show_task()
3340 struct rpc_task *task; in rpc_show_tasks() local
3347 list_for_each_entry(task, &clnt->cl_tasks, tk_task) { in rpc_show_tasks()
3352 rpc_show_task(clnt, task); in rpc_show_tasks()