Lines Matching refs:req

54 static void xprt_free_allocation(struct rpc_rqst *req)  in xprt_free_allocation()  argument
58 dprintk("RPC: free allocations for req= %p\n", req); in xprt_free_allocation()
59 WARN_ON_ONCE(test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state)); in xprt_free_allocation()
60 xbufp = &req->rq_rcv_buf; in xprt_free_allocation()
62 xbufp = &req->rq_snd_buf; in xprt_free_allocation()
64 kfree(req); in xprt_free_allocation()
92 struct rpc_rqst *req; in xprt_alloc_bc_req() local
95 req = kzalloc(sizeof(*req), gfp_flags); in xprt_alloc_bc_req()
96 if (req == NULL) in xprt_alloc_bc_req()
99 req->rq_xprt = xprt; in xprt_alloc_bc_req()
100 INIT_LIST_HEAD(&req->rq_bc_list); in xprt_alloc_bc_req()
103 if (xprt_alloc_xdr_buf(&req->rq_rcv_buf, gfp_flags) < 0) { in xprt_alloc_bc_req()
107 req->rq_rcv_buf.len = PAGE_SIZE; in xprt_alloc_bc_req()
110 if (xprt_alloc_xdr_buf(&req->rq_snd_buf, gfp_flags) < 0) { in xprt_alloc_bc_req()
114 return req; in xprt_alloc_bc_req()
116 xprt_free_allocation(req); in xprt_alloc_bc_req()
148 struct rpc_rqst *req; in xprt_setup_bc() local
168 req = xprt_alloc_bc_req(xprt, GFP_KERNEL); in xprt_setup_bc()
169 if (req == NULL) { in xprt_setup_bc()
175 dprintk("RPC: adding req= %p\n", req); in xprt_setup_bc()
176 list_add(&req->rq_bc_pa_list, &tmp_list); in xprt_setup_bc()
197 req = list_first_entry(&tmp_list, in xprt_setup_bc()
200 list_del(&req->rq_bc_pa_list); in xprt_setup_bc()
201 xprt_free_allocation(req); in xprt_setup_bc()
226 struct rpc_rqst *req = NULL, *tmp = NULL; in xprt_destroy_bc() local
235 list_for_each_entry_safe(req, tmp, &xprt->bc_pa_list, rq_bc_pa_list) { in xprt_destroy_bc()
236 dprintk("RPC: req=%p\n", req); in xprt_destroy_bc()
237 list_del(&req->rq_bc_pa_list); in xprt_destroy_bc()
238 xprt_free_allocation(req); in xprt_destroy_bc()
254 struct rpc_rqst *req = NULL; in xprt_get_bc_request() local
266 req = list_first_entry(&xprt->bc_pa_list, struct rpc_rqst, in xprt_get_bc_request()
268 req->rq_reply_bytes_recvd = 0; in xprt_get_bc_request()
269 memcpy(&req->rq_private_buf, &req->rq_rcv_buf, in xprt_get_bc_request()
270 sizeof(req->rq_private_buf)); in xprt_get_bc_request()
271 req->rq_xid = xid; in xprt_get_bc_request()
272 req->rq_connect_cookie = xprt->connect_cookie; in xprt_get_bc_request()
273 dprintk("RPC: backchannel req=%p\n", req); in xprt_get_bc_request()
275 return req; in xprt_get_bc_request()
282 void xprt_free_bc_request(struct rpc_rqst *req) in xprt_free_bc_request() argument
284 struct rpc_xprt *xprt = req->rq_xprt; in xprt_free_bc_request()
286 xprt->ops->bc_free_rqst(req); in xprt_free_bc_request()
289 void xprt_free_bc_rqst(struct rpc_rqst *req) in xprt_free_bc_rqst() argument
291 struct rpc_xprt *xprt = req->rq_xprt; in xprt_free_bc_rqst()
293 dprintk("RPC: free backchannel req=%p\n", req); in xprt_free_bc_rqst()
295 req->rq_connect_cookie = xprt->connect_cookie - 1; in xprt_free_bc_rqst()
297 clear_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); in xprt_free_bc_rqst()
306 xprt_bc_reinit_xdr_buf(&req->rq_snd_buf); in xprt_free_bc_rqst()
307 xprt_bc_reinit_xdr_buf(&req->rq_rcv_buf); in xprt_free_bc_rqst()
308 req->rq_rcv_buf.len = PAGE_SIZE; in xprt_free_bc_rqst()
309 list_add_tail(&req->rq_bc_pa_list, &xprt->bc_pa_list); in xprt_free_bc_rqst()
312 req = NULL; in xprt_free_bc_rqst()
315 if (req != NULL) { in xprt_free_bc_rqst()
322 dprintk("RPC: Last session removed req=%p\n", req); in xprt_free_bc_rqst()
323 xprt_free_allocation(req); in xprt_free_bc_rqst()
341 struct rpc_rqst *req, *new = NULL; in xprt_lookup_bc_request() local
345 list_for_each_entry(req, &xprt->bc_pa_list, rq_bc_pa_list) { in xprt_lookup_bc_request()
346 if (req->rq_connect_cookie != xprt->connect_cookie) in xprt_lookup_bc_request()
348 if (req->rq_xid == xid) in xprt_lookup_bc_request()
351 req = xprt_get_bc_request(xprt, xid, new); in xprt_lookup_bc_request()
355 if (req != new) in xprt_lookup_bc_request()
358 } else if (req) in xprt_lookup_bc_request()
362 return req; in xprt_lookup_bc_request()
371 void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied) in xprt_complete_bc_request() argument
373 struct rpc_xprt *xprt = req->rq_xprt; in xprt_complete_bc_request()
377 list_del(&req->rq_bc_pa_list); in xprt_complete_bc_request()
381 req->rq_private_buf.len = copied; in xprt_complete_bc_request()
382 set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); in xprt_complete_bc_request()
387 list_add(&req->rq_bc_list, &bc_serv->sv_cb_list); in xprt_complete_bc_request()