• Home
  • Raw
  • Download

Lines Matching refs:req

185 	struct rpc_rqst *req = task->tk_rqstp;  in xprt_reserve_xprt()  local
194 if (req != NULL) in xprt_reserve_xprt()
195 req->rq_ntrans++; in xprt_reserve_xprt()
204 if (req == NULL) in xprt_reserve_xprt()
206 else if (!req->rq_ntrans) in xprt_reserve_xprt()
236 struct rpc_rqst *req = task->tk_rqstp; in xprt_reserve_xprt_cong() local
244 if (req == NULL) { in xprt_reserve_xprt_cong()
250 req->rq_ntrans++; in xprt_reserve_xprt_cong()
255 if (req) in xprt_reserve_xprt_cong()
256 __xprt_put_cong(xprt, req); in xprt_reserve_xprt_cong()
260 if (req == NULL) in xprt_reserve_xprt_cong()
262 else if (!req->rq_ntrans) in xprt_reserve_xprt_cong()
284 struct rpc_rqst *req; in __xprt_lock_write_func() local
286 req = task->tk_rqstp; in __xprt_lock_write_func()
288 if (req) in __xprt_lock_write_func()
289 req->rq_ntrans++; in __xprt_lock_write_func()
307 struct rpc_rqst *req; in __xprt_lock_write_cong_func() local
309 req = task->tk_rqstp; in __xprt_lock_write_cong_func()
310 if (req == NULL) { in __xprt_lock_write_cong_func()
316 req->rq_ntrans++; in __xprt_lock_write_cong_func()
338 struct rpc_rqst *req = task->tk_rqstp; in xprt_task_clear_bytes_sent() local
339 if (req != NULL) in xprt_task_clear_bytes_sent()
340 req->rq_bytes_sent = 0; in xprt_task_clear_bytes_sent()
393 struct rpc_rqst *req = task->tk_rqstp; in __xprt_get_cong() local
395 if (req->rq_cong) in __xprt_get_cong()
401 req->rq_cong = 1; in __xprt_get_cong()
411 __xprt_put_cong(struct rpc_xprt *xprt, struct rpc_rqst *req) in __xprt_put_cong() argument
413 if (!req->rq_cong) in __xprt_put_cong()
415 req->rq_cong = 0; in __xprt_put_cong()
428 struct rpc_rqst *req = task->tk_rqstp; in xprt_release_rqst_cong() local
430 __xprt_put_cong(req->rq_xprt, req); in xprt_release_rqst_cong()
452 struct rpc_rqst *req = task->tk_rqstp; in xprt_adjust_cwnd() local
470 __xprt_put_cong(xprt, req); in xprt_adjust_cwnd()
500 struct rpc_rqst *req = task->tk_rqstp; in xprt_wait_for_buffer_space() local
501 struct rpc_xprt *xprt = req->rq_xprt; in xprt_wait_for_buffer_space()
503 task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0; in xprt_wait_for_buffer_space()
551 struct rpc_rqst *req = task->tk_rqstp; in xprt_set_retrans_timeout_rtt() local
555 task->tk_timeout <<= rpc_ntimeo(rtt, timer) + req->rq_retries; in xprt_set_retrans_timeout_rtt()
561 static void xprt_reset_majortimeo(struct rpc_rqst *req) in xprt_reset_majortimeo() argument
563 const struct rpc_timeout *to = req->rq_task->tk_client->cl_timeout; in xprt_reset_majortimeo()
565 req->rq_majortimeo = req->rq_timeout; in xprt_reset_majortimeo()
567 req->rq_majortimeo <<= to->to_retries; in xprt_reset_majortimeo()
569 req->rq_majortimeo += to->to_increment * to->to_retries; in xprt_reset_majortimeo()
570 if (req->rq_majortimeo > to->to_maxval || req->rq_majortimeo == 0) in xprt_reset_majortimeo()
571 req->rq_majortimeo = to->to_maxval; in xprt_reset_majortimeo()
572 req->rq_majortimeo += jiffies; in xprt_reset_majortimeo()
580 int xprt_adjust_timeout(struct rpc_rqst *req) in xprt_adjust_timeout() argument
582 struct rpc_xprt *xprt = req->rq_xprt; in xprt_adjust_timeout()
583 const struct rpc_timeout *to = req->rq_task->tk_client->cl_timeout; in xprt_adjust_timeout()
586 if (time_before(jiffies, req->rq_majortimeo)) { in xprt_adjust_timeout()
588 req->rq_timeout <<= 1; in xprt_adjust_timeout()
590 req->rq_timeout += to->to_increment; in xprt_adjust_timeout()
591 if (to->to_maxval && req->rq_timeout >= to->to_maxval) in xprt_adjust_timeout()
592 req->rq_timeout = to->to_maxval; in xprt_adjust_timeout()
593 req->rq_retries++; in xprt_adjust_timeout()
595 req->rq_timeout = to->to_initval; in xprt_adjust_timeout()
596 req->rq_retries = 0; in xprt_adjust_timeout()
597 xprt_reset_majortimeo(req); in xprt_adjust_timeout()
600 rpc_init_rtt(req->rq_task->tk_client->cl_rtt, to->to_initval); in xprt_adjust_timeout()
605 if (req->rq_timeout == 0) { in xprt_adjust_timeout()
607 req->rq_timeout = 5 * HZ; in xprt_adjust_timeout()
847 struct rpc_rqst *req = task->tk_rqstp; in xprt_update_rtt() local
850 long m = usecs_to_jiffies(ktime_to_us(req->rq_rtt)); in xprt_update_rtt()
853 if (req->rq_ntrans == 1) in xprt_update_rtt()
855 rpc_set_timeo(rtt, timer, req->rq_ntrans - 1); in xprt_update_rtt()
868 struct rpc_rqst *req = task->tk_rqstp; in xprt_complete_rqst() local
869 struct rpc_xprt *xprt = req->rq_xprt; in xprt_complete_rqst()
872 task->tk_pid, ntohl(req->rq_xid), copied); in xprt_complete_rqst()
873 trace_xprt_complete_rqst(xprt, req->rq_xid, copied); in xprt_complete_rqst()
876 req->rq_rtt = ktime_sub(ktime_get(), req->rq_xtime); in xprt_complete_rqst()
880 list_del_init(&req->rq_list); in xprt_complete_rqst()
881 req->rq_private_buf.len = copied; in xprt_complete_rqst()
885 req->rq_reply_bytes_recvd = copied; in xprt_complete_rqst()
892 struct rpc_rqst *req = task->tk_rqstp; in xprt_timer() local
893 struct rpc_xprt *xprt = req->rq_xprt; in xprt_timer()
900 if (!req->rq_reply_bytes_recvd) { in xprt_timer()
915 struct rpc_rqst *req = task->tk_rqstp; in xprt_prepare_transmit() local
916 struct rpc_xprt *xprt = req->rq_xprt; in xprt_prepare_transmit()
922 if (!req->rq_bytes_sent) { in xprt_prepare_transmit()
923 if (req->rq_reply_bytes_recvd) { in xprt_prepare_transmit()
924 task->tk_status = req->rq_reply_bytes_recvd; in xprt_prepare_transmit()
929 && req->rq_connect_cookie == xprt->connect_cookie) { in xprt_prepare_transmit()
958 struct rpc_rqst *req = task->tk_rqstp; in xprt_transmit() local
959 struct rpc_xprt *xprt = req->rq_xprt; in xprt_transmit()
962 dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen); in xprt_transmit()
964 if (!req->rq_reply_bytes_recvd) { in xprt_transmit()
965 if (list_empty(&req->rq_list) && rpc_reply_expected(task)) { in xprt_transmit()
971 memcpy(&req->rq_private_buf, &req->rq_rcv_buf, in xprt_transmit()
972 sizeof(req->rq_private_buf)); in xprt_transmit()
974 list_add_tail(&req->rq_list, &xprt->recv); in xprt_transmit()
976 xprt_reset_majortimeo(req); in xprt_transmit()
980 } else if (!req->rq_bytes_sent) in xprt_transmit()
983 req->rq_xtime = ktime_get(); in xprt_transmit()
985 trace_xprt_transmit(xprt, req->rq_xid, status); in xprt_transmit()
1015 if (!req->rq_reply_bytes_recvd && rpc_reply_expected(task)) in xprt_transmit()
1017 req->rq_connect_cookie = xprt->connect_cookie; in xprt_transmit()
1052 struct rpc_rqst *req = ERR_PTR(-EAGAIN); in xprt_dynamic_alloc_slot() local
1056 req = kzalloc(sizeof(struct rpc_rqst), gfp_flags); in xprt_dynamic_alloc_slot()
1057 if (req != NULL) in xprt_dynamic_alloc_slot()
1060 req = ERR_PTR(-ENOMEM); in xprt_dynamic_alloc_slot()
1062 return req; in xprt_dynamic_alloc_slot()
1065 static bool xprt_dynamic_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) in xprt_dynamic_free_slot() argument
1068 kfree(req); in xprt_dynamic_free_slot()
1076 struct rpc_rqst *req; in xprt_alloc_slot() local
1080 req = list_entry(xprt->free.next, struct rpc_rqst, rq_list); in xprt_alloc_slot()
1081 list_del(&req->rq_list); in xprt_alloc_slot()
1084 req = xprt_dynamic_alloc_slot(xprt, GFP_NOWAIT|__GFP_NOWARN); in xprt_alloc_slot()
1085 if (!IS_ERR(req)) in xprt_alloc_slot()
1087 switch (PTR_ERR(req)) { in xprt_alloc_slot()
1103 task->tk_rqstp = req; in xprt_alloc_slot()
1123 static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) in xprt_free_slot() argument
1126 if (!xprt_dynamic_free_slot(xprt, req)) { in xprt_free_slot()
1127 memset(req, 0, sizeof(*req)); /* mark unused */ in xprt_free_slot()
1128 list_add(&req->rq_list, &xprt->free); in xprt_free_slot()
1136 struct rpc_rqst *req; in xprt_free_all_slots() local
1138 req = list_first_entry(&xprt->free, struct rpc_rqst, rq_list); in xprt_free_all_slots()
1139 list_del(&req->rq_list); in xprt_free_all_slots()
1140 kfree(req); in xprt_free_all_slots()
1149 struct rpc_rqst *req; in xprt_alloc() local
1159 req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL); in xprt_alloc()
1160 if (!req) in xprt_alloc()
1162 list_add(&req->rq_list, &xprt->free); in xprt_alloc()
1244 struct rpc_rqst *req = task->tk_rqstp; in xprt_request_init() local
1246 INIT_LIST_HEAD(&req->rq_list); in xprt_request_init()
1247 req->rq_timeout = task->tk_client->cl_timeout->to_initval; in xprt_request_init()
1248 req->rq_task = task; in xprt_request_init()
1249 req->rq_xprt = xprt; in xprt_request_init()
1250 req->rq_buffer = NULL; in xprt_request_init()
1251 req->rq_xid = xprt_alloc_xid(xprt); in xprt_request_init()
1252 req->rq_connect_cookie = xprt->connect_cookie - 1; in xprt_request_init()
1253 req->rq_bytes_sent = 0; in xprt_request_init()
1254 req->rq_snd_buf.len = 0; in xprt_request_init()
1255 req->rq_snd_buf.buflen = 0; in xprt_request_init()
1256 req->rq_rcv_buf.len = 0; in xprt_request_init()
1257 req->rq_rcv_buf.buflen = 0; in xprt_request_init()
1258 req->rq_release_snd_buf = NULL; in xprt_request_init()
1259 xprt_reset_majortimeo(req); in xprt_request_init()
1261 req, ntohl(req->rq_xid)); in xprt_request_init()
1272 struct rpc_rqst *req = task->tk_rqstp; in xprt_release() local
1274 if (req == NULL) { in xprt_release()
1283 xprt = req->rq_xprt; in xprt_release()
1292 if (!list_empty(&req->rq_list)) in xprt_release()
1293 list_del(&req->rq_list); in xprt_release()
1297 if (req->rq_buffer) in xprt_release()
1300 if (req->rq_cred != NULL) in xprt_release()
1301 put_rpccred(req->rq_cred); in xprt_release()
1303 if (req->rq_release_snd_buf) in xprt_release()
1304 req->rq_release_snd_buf(req); in xprt_release()
1306 dprintk("RPC: %5u release request %p\n", task->tk_pid, req); in xprt_release()
1307 if (likely(!bc_prealloc(req))) in xprt_release()
1308 xprt_free_slot(xprt, req); in xprt_release()
1310 xprt_free_bc_request(req); in xprt_release()