Lines Matching full:req

40 static void xprt_free_allocation(struct rpc_rqst *req)  in xprt_free_allocation()  argument
44 dprintk("RPC: free allocations for req= %p\n", req); in xprt_free_allocation()
45 WARN_ON_ONCE(test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state)); in xprt_free_allocation()
46 xbufp = &req->rq_rcv_buf; in xprt_free_allocation()
48 xbufp = &req->rq_snd_buf; in xprt_free_allocation()
50 kfree(req); in xprt_free_allocation()
78 struct rpc_rqst *req; in xprt_alloc_bc_req() local
81 req = kzalloc(sizeof(*req), gfp_flags); in xprt_alloc_bc_req()
82 if (req == NULL) in xprt_alloc_bc_req()
85 req->rq_xprt = xprt; in xprt_alloc_bc_req()
88 if (xprt_alloc_xdr_buf(&req->rq_rcv_buf, gfp_flags) < 0) { in xprt_alloc_bc_req()
92 req->rq_rcv_buf.len = PAGE_SIZE; in xprt_alloc_bc_req()
95 if (xprt_alloc_xdr_buf(&req->rq_snd_buf, gfp_flags) < 0) { in xprt_alloc_bc_req()
99 return req; in xprt_alloc_bc_req()
101 xprt_free_allocation(req); in xprt_alloc_bc_req()
133 struct rpc_rqst *req; in xprt_setup_bc() local
153 req = xprt_alloc_bc_req(xprt); in xprt_setup_bc()
154 if (req == NULL) { in xprt_setup_bc()
160 dprintk("RPC: adding req= %p\n", req); in xprt_setup_bc()
161 list_add(&req->rq_bc_pa_list, &tmp_list); in xprt_setup_bc()
182 req = list_first_entry(&tmp_list, in xprt_setup_bc()
185 list_del(&req->rq_bc_pa_list); in xprt_setup_bc()
186 xprt_free_allocation(req); in xprt_setup_bc()
211 struct rpc_rqst *req = NULL, *tmp = NULL; in xprt_destroy_bc() local
220 list_for_each_entry_safe(req, tmp, &xprt->bc_pa_list, rq_bc_pa_list) { in xprt_destroy_bc()
221 dprintk("RPC: req=%p\n", req); in xprt_destroy_bc()
222 list_del(&req->rq_bc_pa_list); in xprt_destroy_bc()
223 xprt_free_allocation(req); in xprt_destroy_bc()
239 struct rpc_rqst *req = NULL; in xprt_get_bc_request() local
251 req = list_first_entry(&xprt->bc_pa_list, struct rpc_rqst, in xprt_get_bc_request()
253 req->rq_reply_bytes_recvd = 0; in xprt_get_bc_request()
254 memcpy(&req->rq_private_buf, &req->rq_rcv_buf, in xprt_get_bc_request()
255 sizeof(req->rq_private_buf)); in xprt_get_bc_request()
256 req->rq_xid = xid; in xprt_get_bc_request()
257 req->rq_connect_cookie = xprt->connect_cookie; in xprt_get_bc_request()
258 dprintk("RPC: backchannel req=%p\n", req); in xprt_get_bc_request()
260 return req; in xprt_get_bc_request()
267 void xprt_free_bc_request(struct rpc_rqst *req) in xprt_free_bc_request() argument
269 struct rpc_xprt *xprt = req->rq_xprt; in xprt_free_bc_request()
271 xprt->ops->bc_free_rqst(req); in xprt_free_bc_request()
274 void xprt_free_bc_rqst(struct rpc_rqst *req) in xprt_free_bc_rqst() argument
276 struct rpc_xprt *xprt = req->rq_xprt; in xprt_free_bc_rqst()
278 dprintk("RPC: free backchannel req=%p\n", req); in xprt_free_bc_rqst()
280 req->rq_connect_cookie = xprt->connect_cookie - 1; in xprt_free_bc_rqst()
282 clear_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); in xprt_free_bc_rqst()
291 xprt_bc_reinit_xdr_buf(&req->rq_snd_buf); in xprt_free_bc_rqst()
292 xprt_bc_reinit_xdr_buf(&req->rq_rcv_buf); in xprt_free_bc_rqst()
293 req->rq_rcv_buf.len = PAGE_SIZE; in xprt_free_bc_rqst()
294 list_add_tail(&req->rq_bc_pa_list, &xprt->bc_pa_list); in xprt_free_bc_rqst()
297 req = NULL; in xprt_free_bc_rqst()
300 if (req != NULL) { in xprt_free_bc_rqst()
307 dprintk("RPC: Last session removed req=%p\n", req); in xprt_free_bc_rqst()
308 xprt_free_allocation(req); in xprt_free_bc_rqst()
326 struct rpc_rqst *req, *new = NULL; in xprt_lookup_bc_request() local
330 list_for_each_entry(req, &xprt->bc_pa_list, rq_bc_pa_list) { in xprt_lookup_bc_request()
331 if (req->rq_connect_cookie != xprt->connect_cookie) in xprt_lookup_bc_request()
333 if (req->rq_xid == xid) in xprt_lookup_bc_request()
336 req = xprt_get_bc_request(xprt, xid, new); in xprt_lookup_bc_request()
340 if (req != new) in xprt_lookup_bc_request()
343 } else if (req) in xprt_lookup_bc_request()
347 return req; in xprt_lookup_bc_request()
354 void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied) in xprt_complete_bc_request() argument
356 struct rpc_xprt *xprt = req->rq_xprt; in xprt_complete_bc_request()
360 list_del(&req->rq_bc_pa_list); in xprt_complete_bc_request()
364 req->rq_private_buf.len = copied; in xprt_complete_bc_request()
365 set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); in xprt_complete_bc_request()
369 lwq_enqueue(&req->rq_bc_list, &bc_serv->sv_cb_list); in xprt_complete_bc_request()