Lines Matching full: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);
879 * @error: RPC task error value to set
891 struct rpc_task *task; in rpc_cancel_tasks() local
900 list_for_each_entry(task, &clnt->cl_tasks, tk_task) { in rpc_cancel_tasks()
901 if (!RPC_IS_ACTIVATED(task)) in rpc_cancel_tasks()
903 if (!fnmatch(task, data)) in rpc_cancel_tasks()
905 rpc_task_try_cancel(task, error); in rpc_cancel_tasks()
1091 void rpc_task_release_transport(struct rpc_task *task) in rpc_task_release_transport() argument
1093 struct rpc_xprt *xprt = task->tk_xprt; in rpc_task_release_transport()
1096 task->tk_xprt = NULL; in rpc_task_release_transport()
1097 if (task->tk_client) in rpc_task_release_transport()
1098 rpc_task_release_xprt(task->tk_client, xprt); in rpc_task_release_transport()
1105 void rpc_task_release_client(struct rpc_task *task) in rpc_task_release_client() argument
1107 struct rpc_clnt *clnt = task->tk_client; in rpc_task_release_client()
1109 rpc_task_release_transport(task); in rpc_task_release_client()
1111 /* Remove from client task list */ in rpc_task_release_client()
1113 list_del(&task->tk_task); in rpc_task_release_client()
1115 task->tk_client = NULL; in rpc_task_release_client()
1139 void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_transport() argument
1141 if (task->tk_xprt) { in rpc_task_set_transport()
1142 if (!(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) && in rpc_task_set_transport()
1143 (task->tk_flags & RPC_TASK_MOVEABLE))) in rpc_task_set_transport()
1145 xprt_release(task); in rpc_task_set_transport()
1146 xprt_put(task->tk_xprt); in rpc_task_set_transport()
1148 if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) in rpc_task_set_transport()
1149 task->tk_xprt = rpc_task_get_first_xprt(clnt); in rpc_task_set_transport()
1151 task->tk_xprt = rpc_task_get_next_xprt(clnt); in rpc_task_set_transport()
1155 void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt) in rpc_task_set_client() argument
1157 rpc_task_set_transport(task, clnt); in rpc_task_set_client()
1158 task->tk_client = clnt; in rpc_task_set_client()
1161 task->tk_flags |= RPC_TASK_SOFT; in rpc_task_set_client()
1163 task->tk_flags |= RPC_TASK_TIMEOUT; in rpc_task_set_client()
1165 task->tk_flags |= RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_task_set_client()
1168 list_add_tail(&task->tk_task, &clnt->cl_tasks); in rpc_task_set_client()
1173 rpc_task_set_rpc_message(struct rpc_task *task, const struct rpc_message *msg) in rpc_task_set_rpc_message() argument
1176 task->tk_msg.rpc_proc = msg->rpc_proc; in rpc_task_set_rpc_message()
1177 task->tk_msg.rpc_argp = msg->rpc_argp; in rpc_task_set_rpc_message()
1178 task->tk_msg.rpc_resp = msg->rpc_resp; in rpc_task_set_rpc_message()
1179 task->tk_msg.rpc_cred = msg->rpc_cred; in rpc_task_set_rpc_message()
1180 if (!(task->tk_flags & RPC_TASK_CRED_NOREF)) in rpc_task_set_rpc_message()
1181 get_cred(task->tk_msg.rpc_cred); in rpc_task_set_rpc_message()
1189 rpc_default_callback(struct rpc_task *task, void *data) in rpc_default_callback() argument
1198 * rpc_run_task - Allocate a new RPC task, then run rpc_execute against it
1199 * @task_setup_data: pointer to task initialisation data
1203 struct rpc_task *task; in rpc_run_task() local
1205 task = rpc_new_task(task_setup_data); in rpc_run_task()
1206 if (IS_ERR(task)) in rpc_run_task()
1207 return task; in rpc_run_task()
1209 if (!RPC_IS_ASYNC(task)) in rpc_run_task()
1210 task->tk_flags |= RPC_TASK_CRED_NOREF; in rpc_run_task()
1212 rpc_task_set_client(task, task_setup_data->rpc_client); in rpc_run_task()
1213 rpc_task_set_rpc_message(task, task_setup_data->rpc_message); in rpc_run_task()
1215 if (task->tk_action == NULL) in rpc_run_task()
1216 rpc_call_start(task); in rpc_run_task()
1218 atomic_inc(&task->tk_count); in rpc_run_task()
1219 rpc_execute(task); in rpc_run_task()
1220 return task; in rpc_run_task()
1232 struct rpc_task *task; in rpc_call_sync() local
1248 task = rpc_run_task(&task_setup_data); in rpc_call_sync()
1249 if (IS_ERR(task)) in rpc_call_sync()
1250 return PTR_ERR(task); in rpc_call_sync()
1251 status = task->tk_status; in rpc_call_sync()
1252 rpc_put_task(task); in rpc_call_sync()
1269 struct rpc_task *task; in rpc_call_async() local
1278 task = rpc_run_task(&task_setup_data); in rpc_call_async()
1279 if (IS_ERR(task)) in rpc_call_async()
1280 return PTR_ERR(task); in rpc_call_async()
1281 rpc_put_task(task); in rpc_call_async()
1287 static void call_bc_encode(struct rpc_task *task);
1290 * rpc_run_bc_task - Allocate a new RPC task for backchannel use, then run
1296 struct rpc_task *task; in rpc_run_bc_task() local
1307 task = rpc_new_task(&task_setup_data); in rpc_run_bc_task()
1308 if (IS_ERR(task)) { in rpc_run_bc_task()
1310 return task; in rpc_run_bc_task()
1313 xprt_init_bc_request(req, task); in rpc_run_bc_task()
1315 task->tk_action = call_bc_encode; in rpc_run_bc_task()
1316 atomic_inc(&task->tk_count); in rpc_run_bc_task()
1317 WARN_ON_ONCE(atomic_read(&task->tk_count) != 2); in rpc_run_bc_task()
1318 rpc_execute(task); in rpc_run_bc_task()
1320 dprintk("RPC: rpc_run_bc_task: task= %p\n", task); in rpc_run_bc_task()
1321 return task; in rpc_run_bc_task()
1346 rpc_call_start(struct rpc_task *task) in rpc_call_start() argument
1348 task->tk_action = call_start; in rpc_call_start()
1646 __rpc_restart_call(struct rpc_task *task, void (*action)(struct rpc_task *)) in __rpc_restart_call() argument
1648 task->tk_status = 0; in __rpc_restart_call()
1649 task->tk_rpc_status = 0; in __rpc_restart_call()
1650 task->tk_action = action; in __rpc_restart_call()
1659 rpc_restart_call(struct rpc_task *task) in rpc_restart_call() argument
1661 return __rpc_restart_call(task, call_start); in rpc_restart_call()
1670 rpc_restart_call_prepare(struct rpc_task *task) in rpc_restart_call_prepare() argument
1672 if (task->tk_ops->rpc_call_prepare != NULL) in rpc_restart_call_prepare()
1673 return __rpc_restart_call(task, rpc_prepare_task); in rpc_restart_call_prepare()
1674 return rpc_restart_call(task); in rpc_restart_call_prepare()
1679 *rpc_proc_name(const struct rpc_task *task) in rpc_proc_name() argument
1681 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in rpc_proc_name()
1693 __rpc_call_rpcerror(struct rpc_task *task, int tk_status, int rpc_status) in __rpc_call_rpcerror() argument
1695 trace_rpc_call_rpcerror(task, tk_status, rpc_status); in __rpc_call_rpcerror()
1696 rpc_task_set_rpc_status(task, rpc_status); in __rpc_call_rpcerror()
1697 rpc_exit(task, tk_status); in __rpc_call_rpcerror()
1701 rpc_call_rpcerror(struct rpc_task *task, int status) in rpc_call_rpcerror() argument
1703 __rpc_call_rpcerror(task, status, status); in rpc_call_rpcerror()
1713 call_start(struct rpc_task *task) in call_start() argument
1715 struct rpc_clnt *clnt = task->tk_client; in call_start()
1716 int idx = task->tk_msg.rpc_proc->p_statidx; in call_start()
1718 trace_rpc_request(task); in call_start()
1724 task->tk_action = call_reserve; in call_start()
1725 rpc_task_set_transport(task, clnt); in call_start()
1732 call_reserve(struct rpc_task *task) in call_reserve() argument
1734 task->tk_status = 0; in call_reserve()
1735 task->tk_action = call_reserveresult; in call_reserve()
1736 xprt_reserve(task); in call_reserve()
1739 static void call_retry_reserve(struct rpc_task *task);
1745 call_reserveresult(struct rpc_task *task) in call_reserveresult() argument
1747 int status = task->tk_status; in call_reserveresult()
1753 task->tk_status = 0; in call_reserveresult()
1755 if (task->tk_rqstp) { in call_reserveresult()
1756 task->tk_action = call_refresh; in call_reserveresult()
1760 rpc_call_rpcerror(task, -EIO); in call_reserveresult()
1766 rpc_delay(task, HZ >> 2); in call_reserveresult()
1769 task->tk_action = call_retry_reserve; in call_reserveresult()
1772 rpc_call_rpcerror(task, status); in call_reserveresult()
1780 call_retry_reserve(struct rpc_task *task) in call_retry_reserve() argument
1782 task->tk_status = 0; in call_retry_reserve()
1783 task->tk_action = call_reserveresult; in call_retry_reserve()
1784 xprt_retry_reserve(task); in call_retry_reserve()
1791 call_refresh(struct rpc_task *task) in call_refresh() argument
1793 task->tk_action = call_refreshresult; in call_refresh()
1794 task->tk_status = 0; in call_refresh()
1795 task->tk_client->cl_stats->rpcauthrefresh++; in call_refresh()
1796 rpcauth_refreshcred(task); in call_refresh()
1803 call_refreshresult(struct rpc_task *task) in call_refreshresult() argument
1805 int status = task->tk_status; in call_refreshresult()
1807 task->tk_status = 0; in call_refreshresult()
1808 task->tk_action = call_refresh; in call_refreshresult()
1811 if (rpcauth_uptodatecred(task)) { in call_refreshresult()
1812 task->tk_action = call_allocate; in call_refreshresult()
1820 rpc_delay(task, 3*HZ); in call_refreshresult()
1826 if (!task->tk_cred_retry) in call_refreshresult()
1828 task->tk_cred_retry--; in call_refreshresult()
1829 trace_rpc_retry_refresh_status(task); in call_refreshresult()
1832 rpc_delay(task, HZ >> 4); in call_refreshresult()
1835 trace_rpc_refresh_status(task); in call_refreshresult()
1836 rpc_call_rpcerror(task, status); in call_refreshresult()
1844 call_allocate(struct rpc_task *task) in call_allocate() argument
1846 const struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth; in call_allocate()
1847 struct rpc_rqst *req = task->tk_rqstp; in call_allocate()
1849 const struct rpc_procinfo *proc = task->tk_msg.rpc_proc; in call_allocate()
1852 task->tk_status = 0; in call_allocate()
1853 task->tk_action = call_encode; in call_allocate()
1880 status = xprt->ops->buf_alloc(task); in call_allocate()
1881 trace_rpc_buf_alloc(task, status); in call_allocate()
1885 rpc_call_rpcerror(task, status); in call_allocate()
1889 if (RPC_IS_ASYNC(task) || !fatal_signal_pending(current)) { in call_allocate()
1890 task->tk_action = call_allocate; in call_allocate()
1891 rpc_delay(task, HZ>>4); in call_allocate()
1895 rpc_call_rpcerror(task, -ERESTARTSYS); in call_allocate()
1899 rpc_task_need_encode(struct rpc_task *task) in rpc_task_need_encode() argument
1901 return test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate) == 0 && in rpc_task_need_encode()
1902 (!(task->tk_flags & RPC_TASK_SENT) || in rpc_task_need_encode()
1903 !(task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) || in rpc_task_need_encode()
1904 xprt_request_need_retransmit(task)); in rpc_task_need_encode()
1908 rpc_xdr_encode(struct rpc_task *task) in rpc_xdr_encode() argument
1910 struct rpc_rqst *req = task->tk_rqstp; in rpc_xdr_encode()
1924 if (rpc_encode_header(task, &xdr)) in rpc_xdr_encode()
1927 task->tk_status = rpcauth_wrap_req(task, &xdr); in rpc_xdr_encode()
1934 call_encode(struct rpc_task *task) in call_encode() argument
1936 if (!rpc_task_need_encode(task)) in call_encode()
1939 /* Dequeue task from the receive queue while we're encoding */ in call_encode()
1940 xprt_request_dequeue_xprt(task); in call_encode()
1942 rpc_xdr_encode(task); in call_encode()
1943 /* Add task to reply queue before transmission to avoid races */ in call_encode()
1944 if (task->tk_status == 0 && rpc_reply_expected(task)) in call_encode()
1945 task->tk_status = xprt_request_enqueue_receive(task); in call_encode()
1947 if (task->tk_status != 0) { in call_encode()
1949 switch (task->tk_status) { in call_encode()
1952 rpc_delay(task, HZ >> 4); in call_encode()
1955 if (!task->tk_cred_retry) { in call_encode()
1956 rpc_call_rpcerror(task, task->tk_status); in call_encode()
1958 task->tk_action = call_refresh; in call_encode()
1959 task->tk_cred_retry--; in call_encode()
1960 trace_rpc_retry_refresh_status(task); in call_encode()
1964 rpc_call_rpcerror(task, task->tk_status); in call_encode()
1969 xprt_request_enqueue_transmit(task); in call_encode()
1971 task->tk_action = call_transmit; in call_encode()
1973 if (!xprt_bound(task->tk_xprt)) in call_encode()
1974 task->tk_action = call_bind; in call_encode()
1975 else if (!xprt_connected(task->tk_xprt)) in call_encode()
1976 task->tk_action = call_connect; in call_encode()
1980 * Helpers to check if the task was already transmitted, and
1984 rpc_task_transmitted(struct rpc_task *task) in rpc_task_transmitted() argument
1986 return !test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate); in rpc_task_transmitted()
1990 rpc_task_handle_transmitted(struct rpc_task *task) in rpc_task_handle_transmitted() argument
1992 xprt_end_transmit(task); in rpc_task_handle_transmitted()
1993 task->tk_action = call_transmit_status; in rpc_task_handle_transmitted()
2000 call_bind(struct rpc_task *task) in call_bind() argument
2002 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind()
2004 if (rpc_task_transmitted(task)) { in call_bind()
2005 rpc_task_handle_transmitted(task); in call_bind()
2010 task->tk_action = call_connect; in call_bind()
2014 task->tk_action = call_bind_status; in call_bind()
2015 if (!xprt_prepare_transmit(task)) in call_bind()
2018 xprt->ops->rpcbind(task); in call_bind()
2025 call_bind_status(struct rpc_task *task) in call_bind_status() argument
2027 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_bind_status()
2030 if (rpc_task_transmitted(task)) { in call_bind_status()
2031 rpc_task_handle_transmitted(task); in call_bind_status()
2035 if (task->tk_status >= 0) in call_bind_status()
2038 task->tk_status = 0; in call_bind_status()
2042 switch (task->tk_status) { in call_bind_status()
2044 rpc_delay(task, HZ >> 2); in call_bind_status()
2047 trace_rpcb_prog_unavail_err(task); in call_bind_status()
2049 if (task->tk_msg.rpc_proc->p_proc == 0) { in call_bind_status()
2053 if (task->tk_rebind_retry == 0) in call_bind_status()
2055 task->tk_rebind_retry--; in call_bind_status()
2056 rpc_delay(task, 3*HZ); in call_bind_status()
2059 rpc_delay(task, HZ >> 2); in call_bind_status()
2064 trace_rpcb_timeout_err(task); in call_bind_status()
2068 trace_rpcb_bind_version_err(task); in call_bind_status()
2071 trace_rpcb_bind_version_err(task); in call_bind_status()
2082 trace_rpcb_unreachable_err(task); in call_bind_status()
2083 if (!RPC_IS_SOFTCONN(task)) { in call_bind_status()
2084 rpc_delay(task, 5*HZ); in call_bind_status()
2087 status = task->tk_status; in call_bind_status()
2090 trace_rpcb_unrecognized_err(task); in call_bind_status()
2093 rpc_call_rpcerror(task, status); in call_bind_status()
2096 task->tk_action = call_connect; in call_bind_status()
2099 task->tk_status = 0; in call_bind_status()
2100 task->tk_action = call_bind; in call_bind_status()
2101 rpc_check_timeout(task); in call_bind_status()
2108 call_connect(struct rpc_task *task) in call_connect() argument
2110 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect()
2112 if (rpc_task_transmitted(task)) { in call_connect()
2113 rpc_task_handle_transmitted(task); in call_connect()
2118 task->tk_action = call_transmit; in call_connect()
2122 task->tk_action = call_connect_status; in call_connect()
2123 if (task->tk_status < 0) in call_connect()
2125 if (task->tk_flags & RPC_TASK_NOCONNECT) { in call_connect()
2126 rpc_call_rpcerror(task, -ENOTCONN); in call_connect()
2129 if (!xprt_prepare_transmit(task)) in call_connect()
2131 xprt_connect(task); in call_connect()
2138 call_connect_status(struct rpc_task *task) in call_connect_status() argument
2140 struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; in call_connect_status()
2141 struct rpc_clnt *clnt = task->tk_client; in call_connect_status()
2142 int status = task->tk_status; in call_connect_status()
2144 if (rpc_task_transmitted(task)) { in call_connect_status()
2145 rpc_task_handle_transmitted(task); in call_connect_status()
2149 trace_rpc_connect_status(task); in call_connect_status()
2151 if (task->tk_status == 0) { in call_connect_status()
2156 task->tk_status = 0; in call_connect_status()
2160 task->tk_status = 0; in call_connect_status()
2164 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2178 xprt_conditional_disconnect(task->tk_rqstp->rq_xprt, in call_connect_status()
2179 task->tk_rqstp->rq_connect_cookie); in call_connect_status()
2180 if (RPC_IS_SOFTCONN(task)) in call_connect_status()
2183 rpc_delay(task, 3*HZ); in call_connect_status()
2189 if (!(task->tk_flags & RPC_TASK_NO_ROUND_ROBIN) && in call_connect_status()
2190 (task->tk_flags & RPC_TASK_MOVEABLE) && in call_connect_status()
2192 struct rpc_xprt *saved = task->tk_xprt; in call_connect_status()
2201 xprt_release(task); in call_connect_status()
2207 task->tk_xprt = NULL; in call_connect_status()
2208 task->tk_action = call_start; in call_connect_status()
2211 if (!task->tk_xprt) in call_connect_status()
2216 rpc_delay(task, HZ >> 2); in call_connect_status()
2219 rpc_call_rpcerror(task, status); in call_connect_status()
2222 task->tk_action = call_transmit; in call_connect_status()
2226 task->tk_action = call_bind; in call_connect_status()
2227 rpc_check_timeout(task); in call_connect_status()
2234 call_transmit(struct rpc_task *task) in call_transmit() argument
2236 if (rpc_task_transmitted(task)) { in call_transmit()
2237 rpc_task_handle_transmitted(task); in call_transmit()
2241 task->tk_action = call_transmit_status; in call_transmit()
2242 if (!xprt_prepare_transmit(task)) in call_transmit()
2244 task->tk_status = 0; in call_transmit()
2245 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_transmit()
2246 if (!xprt_connected(task->tk_xprt)) { in call_transmit()
2247 task->tk_status = -ENOTCONN; in call_transmit()
2250 xprt_transmit(task); in call_transmit()
2252 xprt_end_transmit(task); in call_transmit()
2259 call_transmit_status(struct rpc_task *task) in call_transmit_status() argument
2261 task->tk_action = call_status; in call_transmit_status()
2267 if (rpc_task_transmitted(task)) { in call_transmit_status()
2268 task->tk_status = 0; in call_transmit_status()
2269 xprt_request_wait_receive(task); in call_transmit_status()
2273 switch (task->tk_status) { in call_transmit_status()
2277 task->tk_status = 0; in call_transmit_status()
2278 task->tk_action = call_encode; in call_transmit_status()
2288 rpc_delay(task, HZ>>2); in call_transmit_status()
2292 task->tk_action = call_transmit; in call_transmit_status()
2293 task->tk_status = 0; in call_transmit_status()
2301 if (RPC_IS_SOFTCONN(task)) { in call_transmit_status()
2302 if (!task->tk_msg.rpc_proc->p_proc) in call_transmit_status()
2303 trace_xprt_ping(task->tk_xprt, in call_transmit_status()
2304 task->tk_status); in call_transmit_status()
2305 rpc_call_rpcerror(task, task->tk_status); in call_transmit_status()
2314 task->tk_action = call_bind; in call_transmit_status()
2315 task->tk_status = 0; in call_transmit_status()
2318 rpc_check_timeout(task); in call_transmit_status()
2322 static void call_bc_transmit(struct rpc_task *task);
2323 static void call_bc_transmit_status(struct rpc_task *task);
2326 call_bc_encode(struct rpc_task *task) in call_bc_encode() argument
2328 xprt_request_enqueue_transmit(task); in call_bc_encode()
2329 task->tk_action = call_bc_transmit; in call_bc_encode()
2337 call_bc_transmit(struct rpc_task *task) in call_bc_transmit() argument
2339 task->tk_action = call_bc_transmit_status; in call_bc_transmit()
2340 if (test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) { in call_bc_transmit()
2341 if (!xprt_prepare_transmit(task)) in call_bc_transmit()
2343 task->tk_status = 0; in call_bc_transmit()
2344 xprt_transmit(task); in call_bc_transmit()
2346 xprt_end_transmit(task); in call_bc_transmit()
2350 call_bc_transmit_status(struct rpc_task *task) in call_bc_transmit_status() argument
2352 struct rpc_rqst *req = task->tk_rqstp; in call_bc_transmit_status()
2354 if (rpc_task_transmitted(task)) in call_bc_transmit_status()
2355 task->tk_status = 0; in call_bc_transmit_status()
2357 switch (task->tk_status) { in call_bc_transmit_status()
2372 rpc_delay(task, HZ>>2); in call_bc_transmit_status()
2376 task->tk_status = 0; in call_bc_transmit_status()
2377 task->tk_action = call_bc_transmit; in call_bc_transmit_status()
2388 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2398 "error: %d\n", task->tk_status); in call_bc_transmit_status()
2401 task->tk_action = rpc_exit_task; in call_bc_transmit_status()
2409 call_status(struct rpc_task *task) in call_status() argument
2411 struct rpc_clnt *clnt = task->tk_client; in call_status()
2414 if (!task->tk_msg.rpc_proc->p_proc) in call_status()
2415 trace_xprt_ping(task->tk_xprt, task->tk_status); in call_status()
2417 status = task->tk_status; in call_status()
2419 task->tk_action = call_decode; in call_status()
2423 trace_rpc_call_status(task); in call_status()
2424 task->tk_status = 0; in call_status()
2431 if (RPC_IS_SOFTCONN(task)) in call_status()
2437 rpc_delay(task, 3*HZ); in call_status()
2448 rpc_delay(task, 3*HZ); in call_status()
2456 rpc_delay(task, HZ>>2); in call_status()
2467 task->tk_action = call_encode; in call_status()
2469 rpc_check_timeout(task); in call_status()
2472 rpc_call_rpcerror(task, status); in call_status()
2485 rpc_check_timeout(struct rpc_task *task) in rpc_check_timeout() argument
2487 struct rpc_clnt *clnt = task->tk_client; in rpc_check_timeout()
2489 if (RPC_SIGNALLED(task)) in rpc_check_timeout()
2492 if (xprt_adjust_timeout(task->tk_rqstp) == 0) in rpc_check_timeout()
2495 trace_rpc_timeout_status(task); in rpc_check_timeout()
2496 task->tk_timeouts++; in rpc_check_timeout()
2498 if (RPC_IS_SOFTCONN(task) && !rpc_check_connected(task->tk_rqstp)) { in rpc_check_timeout()
2499 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2503 if (RPC_IS_SOFT(task)) { in rpc_check_timeout()
2509 if ((task->tk_flags & RPC_TASK_NO_RETRANS_TIMEOUT) && in rpc_check_timeout()
2510 rpc_check_connected(task->tk_rqstp)) in rpc_check_timeout()
2517 task->tk_xprt->servername); in rpc_check_timeout()
2519 if (task->tk_flags & RPC_TASK_TIMEOUT) in rpc_check_timeout()
2520 rpc_call_rpcerror(task, -ETIMEDOUT); in rpc_check_timeout()
2522 __rpc_call_rpcerror(task, -EIO, -ETIMEDOUT); in rpc_check_timeout()
2526 if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) { in rpc_check_timeout()
2527 task->tk_flags |= RPC_CALL_MAJORSEEN; in rpc_check_timeout()
2532 task->tk_xprt->servername); in rpc_check_timeout()
2540 rpcauth_invalcred(task); in rpc_check_timeout()
2547 call_decode(struct rpc_task *task) in call_decode() argument
2549 struct rpc_clnt *clnt = task->tk_client; in call_decode()
2550 struct rpc_rqst *req = task->tk_rqstp; in call_decode()
2554 if (!task->tk_msg.rpc_proc->p_decode) { in call_decode()
2555 task->tk_action = rpc_exit_task; in call_decode()
2559 if (task->tk_flags & RPC_CALL_MAJORSEEN) { in call_decode()
2563 task->tk_xprt->servername); in call_decode()
2565 task->tk_flags &= ~RPC_CALL_MAJORSEEN; in call_decode()
2582 trace_rpc_xdr_recvfrom(task, &req->rq_rcv_buf); in call_decode()
2590 err = rpc_decode_header(task, &xdr); in call_decode()
2594 task->tk_action = rpc_exit_task; in call_decode()
2595 task->tk_status = rpcauth_unwrap_resp(task, &xdr); in call_decode()
2598 task->tk_status = 0; in call_decode()
2599 if (task->tk_client->cl_discrtry) in call_decode()
2602 task->tk_action = call_encode; in call_decode()
2603 rpc_check_timeout(task); in call_decode()
2606 task->tk_action = call_reserve; in call_decode()
2607 rpc_check_timeout(task); in call_decode()
2608 rpcauth_invalcred(task); in call_decode()
2610 xprt_release(task); in call_decode()
2615 rpc_encode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_encode_header() argument
2617 struct rpc_clnt *clnt = task->tk_client; in rpc_encode_header()
2618 struct rpc_rqst *req = task->tk_rqstp; in rpc_encode_header()
2631 *p = cpu_to_be32(task->tk_msg.rpc_proc->p_proc); in rpc_encode_header()
2633 error = rpcauth_marshcred(task, xdr); in rpc_encode_header()
2638 trace_rpc_bad_callhdr(task); in rpc_encode_header()
2639 rpc_call_rpcerror(task, error); in rpc_encode_header()
2644 rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr) in rpc_decode_header() argument
2646 struct rpc_clnt *clnt = task->tk_client; in rpc_decode_header()
2655 if (task->tk_rqstp->rq_rcv_buf.len & 3) in rpc_decode_header()
2667 error = rpcauth_checkverf(task, xdr); in rpc_decode_header()
2678 trace_rpc__prog_unavail(task); in rpc_decode_header()
2682 trace_rpc__prog_mismatch(task); in rpc_decode_header()
2686 trace_rpc__proc_unavail(task); in rpc_decode_header()
2691 trace_rpc__garbage_args(task); in rpc_decode_header()
2700 if (task->tk_garb_retry) { in rpc_decode_header()
2701 task->tk_garb_retry--; in rpc_decode_header()
2702 task->tk_action = call_encode; in rpc_decode_header()
2706 rpc_call_rpcerror(task, error); in rpc_decode_header()
2710 trace_rpc__unparsable(task); in rpc_decode_header()
2715 trace_rpc_bad_verifier(task); in rpc_decode_header()
2727 trace_rpc__mismatch(task); in rpc_decode_header()
2742 if (!task->tk_cred_retry) in rpc_decode_header()
2744 task->tk_cred_retry--; in rpc_decode_header()
2745 trace_rpc__stale_creds(task); in rpc_decode_header()
2750 if (!task->tk_garb_retry) in rpc_decode_header()
2752 task->tk_garb_retry--; in rpc_decode_header()
2753 trace_rpc__bad_creds(task); in rpc_decode_header()
2754 task->tk_action = call_encode; in rpc_decode_header()
2757 trace_rpc__auth_tooweak(task); in rpc_decode_header()
2759 task->tk_xprt->servername); in rpc_decode_header()
2788 rpc_null_call_prepare(struct rpc_task *task, void *data) in rpc_null_call_prepare() argument
2790 task->tk_flags &= ~RPC_TASK_NO_RETRANS_TIMEOUT; in rpc_null_call_prepare()
2791 rpc_call_start(task); in rpc_null_call_prepare()
2829 struct rpc_task *task; in rpc_ping() local
2832 task = rpc_call_null_helper(clnt, NULL, NULL, 0, NULL, NULL); in rpc_ping()
2833 if (IS_ERR(task)) in rpc_ping()
2834 return PTR_ERR(task); in rpc_ping()
2835 status = task->tk_status; in rpc_ping()
2836 rpc_put_task(task); in rpc_ping()
2851 struct rpc_task *task; in rpc_ping_noreply() local
2854 task = rpc_run_task(&task_setup_data); in rpc_ping_noreply()
2855 if (IS_ERR(task)) in rpc_ping_noreply()
2856 return PTR_ERR(task); in rpc_ping_noreply()
2857 status = task->tk_status; in rpc_ping_noreply()
2858 rpc_put_task(task); in rpc_ping_noreply()
2867 static void rpc_cb_add_xprt_done(struct rpc_task *task, void *calldata) in rpc_cb_add_xprt_done() argument
2871 if (task->tk_status == 0) in rpc_cb_add_xprt_done()
2902 struct rpc_task *task; in rpc_clnt_test_and_add_xprt() local
2923 task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_ASYNC, in rpc_clnt_test_and_add_xprt()
2925 if (IS_ERR(task)) in rpc_clnt_test_and_add_xprt()
2926 return PTR_ERR(task); in rpc_clnt_test_and_add_xprt()
2929 rpc_put_task(task); in rpc_clnt_test_and_add_xprt()
2939 struct rpc_task *task; in rpc_clnt_add_xprt_helper() local
2943 task = rpc_call_null_helper(clnt, xprt, NULL, 0, NULL, NULL); in rpc_clnt_add_xprt_helper()
2944 if (IS_ERR(task)) in rpc_clnt_add_xprt_helper()
2945 return PTR_ERR(task); in rpc_clnt_add_xprt_helper()
2947 status = task->tk_status; in rpc_clnt_add_xprt_helper()
2948 rpc_put_task(task); in rpc_clnt_add_xprt_helper()
3283 const struct rpc_task *task) in rpc_show_task() argument
3287 if (RPC_IS_QUEUED(task)) in rpc_show_task()
3288 rpc_waitq = rpc_qname(task->tk_waitqueue); in rpc_show_task()
3291 task->tk_pid, task->tk_flags, task->tk_status, in rpc_show_task()
3292 clnt, task->tk_rqstp, rpc_task_timeout(task), task->tk_ops, in rpc_show_task()
3293 clnt->cl_program->name, clnt->cl_vers, rpc_proc_name(task), in rpc_show_task()
3294 task->tk_action, rpc_waitq); in rpc_show_task()
3300 struct rpc_task *task; in rpc_show_tasks() local
3307 list_for_each_entry(task, &clnt->cl_tasks, tk_task) { in rpc_show_tasks()
3312 rpc_show_task(clnt, task); in rpc_show_tasks()