Lines Matching refs:task

88 static void	xprt_connect_status(struct rpc_task *task);
139 __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) in __xprt_lock_write() argument
141 struct rpc_rqst *req = task->tk_rqstp; in __xprt_lock_write()
143 if (xprt->nocong || __xprt_get_cong(xprt, task)) { in __xprt_lock_write()
144 xprt->snd_task = task; in __xprt_lock_write()
151 if (xprt->snd_task != task) { in __xprt_lock_write()
152 dprintk("RPC: %4d TCP write queue full\n", task->tk_pid); in __xprt_lock_write()
153 task->tk_timeout = 0; in __xprt_lock_write()
154 task->tk_status = -EAGAIN; in __xprt_lock_write()
156 rpc_sleep_on(&xprt->resend, task, NULL, NULL); in __xprt_lock_write()
158 rpc_sleep_on(&xprt->sending, task, NULL, NULL); in __xprt_lock_write()
160 return xprt->snd_task == task; in __xprt_lock_write()
164 xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) in xprt_lock_write() argument
168 retval = __xprt_lock_write(xprt, task); in xprt_lock_write()
176 struct rpc_task *task; in __xprt_lock_write_next() local
180 task = rpc_wake_up_next(&xprt->resend); in __xprt_lock_write_next()
181 if (!task) { in __xprt_lock_write_next()
184 task = rpc_wake_up_next(&xprt->sending); in __xprt_lock_write_next()
185 if (!task) in __xprt_lock_write_next()
188 if (xprt->nocong || __xprt_get_cong(xprt, task)) { in __xprt_lock_write_next()
189 struct rpc_rqst *req = task->tk_rqstp; in __xprt_lock_write_next()
190 xprt->snd_task = task; in __xprt_lock_write_next()
202 __xprt_release_write(struct rpc_xprt *xprt, struct rpc_task *task) in __xprt_release_write() argument
204 if (xprt->snd_task == task) in __xprt_release_write()
210 xprt_release_write(struct rpc_xprt *xprt, struct rpc_task *task) in xprt_release_write() argument
213 __xprt_release_write(xprt, task); in xprt_release_write()
303 __xprt_get_cong(struct rpc_xprt *xprt, struct rpc_task *task) in __xprt_get_cong() argument
305 struct rpc_rqst *req = task->tk_rqstp; in __xprt_get_cong()
310 task->tk_pid, xprt->cong, xprt->cwnd); in __xprt_get_cong()
437 xprt_connect(struct rpc_task *task) in xprt_connect() argument
439 struct rpc_xprt *xprt = task->tk_xprt; in xprt_connect()
445 task->tk_pid, xprt, xprt_connected(xprt)); in xprt_connect()
450 task->tk_status = -EIO; in xprt_connect()
454 if (!xprt_lock_write(xprt, task)) in xprt_connect()
459 if (task->tk_rqstp) in xprt_connect()
460 task->tk_rqstp->rq_bytes_sent = 0; in xprt_connect()
468 task->tk_status = -EIO; in xprt_connect()
479 dprintk("RPC: %4d connecting new socket\n", task->tk_pid); in xprt_connect()
483 task->tk_pid, status, xprt_connected(xprt)); in xprt_connect()
495 task->tk_pid); in xprt_connect()
496 task->tk_timeout = RPC_CONNECT_TIMEOUT; in xprt_connect()
499 task->tk_timeout = RPC_REESTABLISH_TIMEOUT; in xprt_connect()
500 rpc_sleep_on(&xprt->pending, task, xprt_connect_status, in xprt_connect()
508 if (!task->tk_client->cl_softrtry) { in xprt_connect()
509 rpc_delay(task, RPC_REESTABLISH_TIMEOUT); in xprt_connect()
510 task->tk_status = -ENOTCONN; in xprt_connect()
516 if (task->tk_client->cl_softrtry) { in xprt_connect()
519 -status, task->tk_client->cl_server); in xprt_connect()
520 task->tk_status = -EIO; in xprt_connect()
524 -status, task->tk_client->cl_server); in xprt_connect()
526 rpc_delay(task, RPC_REESTABLISH_TIMEOUT); in xprt_connect()
527 task->tk_status = status; in xprt_connect()
532 xprt_release_write(xprt, task); in xprt_connect()
539 xprt_connect_status(struct rpc_task *task) in xprt_connect_status() argument
541 struct rpc_xprt *xprt = task->tk_xprt; in xprt_connect_status()
543 if (task->tk_status >= 0) { in xprt_connect_status()
545 task->tk_pid); in xprt_connect_status()
550 if (task->tk_client->cl_softrtry) in xprt_connect_status()
551 task->tk_status = -EIO; in xprt_connect_status()
553 switch (task->tk_status) { in xprt_connect_status()
555 rpc_delay(task, RPC_REESTABLISH_TIMEOUT); in xprt_connect_status()
559 task->tk_pid); in xprt_connect_status()
563 -task->tk_status, task->tk_client->cl_server); in xprt_connect_status()
565 xprt_release_write(xprt, task); in xprt_connect_status()
594 struct rpc_task *task = req->rq_task; in xprt_complete_rqst() local
595 struct rpc_clnt *clnt = task->tk_client; in xprt_complete_rqst()
599 int timer = rpcproc_timer(clnt, task->tk_msg.rpc_proc); in xprt_complete_rqst()
628 dprintk("RPC: %4d has input (%d bytes)\n", task->tk_pid, copied); in xprt_complete_rqst()
633 rpc_wake_up_task(task); in xprt_complete_rqst()
701 struct rpc_task *task; in udp_data_ready() local
733 task = rovr->rq_task; in udp_data_ready()
735 dprintk("RPC: %4d received reply\n", task->tk_pid); in udp_data_ready()
1062 xprt_timer(struct rpc_task *task) in xprt_timer() argument
1064 struct rpc_rqst *req = task->tk_rqstp; in xprt_timer()
1075 task->tk_pid, req ? "pending" : "backlogged"); in xprt_timer()
1077 task->tk_status = -ETIMEDOUT; in xprt_timer()
1079 task->tk_timeout = 0; in xprt_timer()
1080 rpc_wake_up_task(task); in xprt_timer()
1089 xprt_transmit(struct rpc_task *task) in xprt_transmit() argument
1091 struct rpc_rqst *req = task->tk_rqstp; in xprt_transmit()
1094 dprintk("RPC: %4d xprt_transmit(%x)\n", task->tk_pid, in xprt_transmit()
1098 task->tk_status = -EIO; in xprt_transmit()
1100 if (task->tk_status < 0) in xprt_transmit()
1103 if (task->tk_rpcwait) in xprt_transmit()
1104 rpc_remove_wait_queue(task); in xprt_transmit()
1118 if (!__xprt_lock_write(xprt, task)) in xprt_transmit()
1122 task->tk_status = -ENOTCONN; in xprt_transmit()
1134 do_xprt_transmit(task); in xprt_transmit()
1141 do_xprt_transmit(struct rpc_task *task) in do_xprt_transmit() argument
1143 struct rpc_clnt *clnt = task->tk_client; in do_xprt_transmit()
1144 struct rpc_rqst *req = task->tk_rqstp; in do_xprt_transmit()
1177 task->tk_pid, req->rq_slen - req->rq_bytes_sent, in do_xprt_transmit()
1190 task->tk_status = status; in do_xprt_transmit()
1199 task->tk_status = -ENOTCONN; in do_xprt_transmit()
1201 task->tk_timeout = req->rq_timeout.to_current; in do_xprt_transmit()
1202 rpc_sleep_on(&xprt->pending, task, NULL, NULL); in do_xprt_transmit()
1208 rpc_delay(task, HZ>>4); in do_xprt_transmit()
1211 task->tk_timeout = RPC_REESTABLISH_TIMEOUT; in do_xprt_transmit()
1212 rpc_sleep_on(&xprt->sending, task, NULL, NULL); in do_xprt_transmit()
1219 xprt_release_write(xprt, task); in do_xprt_transmit()
1222 dprintk("RPC: %4d xmit complete\n", task->tk_pid); in do_xprt_transmit()
1226 int timer = rpcproc_timer(clnt, task->tk_msg.rpc_proc); in do_xprt_transmit()
1227 task->tk_timeout = rpc_calc_rto(&clnt->cl_rtt, timer); in do_xprt_transmit()
1228 task->tk_timeout <<= rpc_ntimeo(&clnt->cl_rtt, timer); in do_xprt_transmit()
1229 task->tk_timeout <<= clnt->cl_timeout.to_retries in do_xprt_transmit()
1231 if (task->tk_timeout > req->rq_timeout.to_maxval) in do_xprt_transmit()
1232 task->tk_timeout = req->rq_timeout.to_maxval; in do_xprt_transmit()
1234 task->tk_timeout = req->rq_timeout.to_current; in do_xprt_transmit()
1237 task->tk_status = -ENOTCONN; in do_xprt_transmit()
1239 rpc_sleep_on(&xprt->pending, task, NULL, xprt_timer); in do_xprt_transmit()
1240 __xprt_release_write(xprt, task); in do_xprt_transmit()
1248 do_xprt_reserve(struct rpc_task *task) in do_xprt_reserve() argument
1250 struct rpc_xprt *xprt = task->tk_xprt; in do_xprt_reserve()
1252 task->tk_status = 0; in do_xprt_reserve()
1253 if (task->tk_rqstp) in do_xprt_reserve()
1259 task->tk_rqstp = req; in do_xprt_reserve()
1260 xprt_request_init(task, xprt); in do_xprt_reserve()
1264 task->tk_status = -EAGAIN; in do_xprt_reserve()
1265 task->tk_timeout = 0; in do_xprt_reserve()
1266 rpc_sleep_on(&xprt->backlog, task, NULL, NULL); in do_xprt_reserve()
1270 xprt_reserve(struct rpc_task *task) in xprt_reserve() argument
1272 struct rpc_xprt *xprt = task->tk_xprt; in xprt_reserve()
1274 task->tk_status = -EIO; in xprt_reserve()
1277 do_xprt_reserve(task); in xprt_reserve()
1307 xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt) in xprt_request_init() argument
1309 struct rpc_rqst *req = task->tk_rqstp; in xprt_request_init()
1312 req->rq_task = task; in xprt_request_init()
1316 dprintk("RPC: %4d reserved req %p xid %08x\n", task->tk_pid, in xprt_request_init()
1324 xprt_release(struct rpc_task *task) in xprt_release() argument
1326 struct rpc_xprt *xprt = task->tk_xprt; in xprt_release()
1329 if (!(req = task->tk_rqstp)) in xprt_release()
1332 __xprt_release_write(xprt, task); in xprt_release()
1337 task->tk_rqstp = NULL; in xprt_release()
1340 dprintk("RPC: %4d release request %p\n", task->tk_pid, req); in xprt_release()