Lines Matching defs:xprt
26 #include <linux/sunrpc/xprt.h>
38 static inline int xprt_need_to_requeue(struct rpc_xprt *xprt)
40 return xprt->bc_alloc_count > 0;
43 static inline void xprt_inc_alloc_count(struct rpc_xprt *xprt, unsigned int n)
45 xprt->bc_alloc_count += n;
48 static inline int xprt_dec_alloc_count(struct rpc_xprt *xprt, unsigned int n)
50 return xprt->bc_alloc_count -= n;
89 int xprt_setup_backchannel(struct rpc_xprt *xprt, unsigned int min_reqs)
120 req->rq_xprt = xprt;
159 spin_lock_bh(&xprt->bc_pa_lock);
160 list_splice(&tmp_list, &xprt->bc_pa_list);
161 xprt_inc_alloc_count(xprt, min_reqs);
162 spin_unlock_bh(&xprt->bc_pa_lock);
184 * @xprt: the transport holding the preallocated strucures
187 void xprt_destroy_backchannel(struct rpc_xprt *xprt, unsigned int max_reqs)
194 spin_lock_bh(&xprt->bc_pa_lock);
195 xprt_dec_alloc_count(xprt, max_reqs);
196 list_for_each_entry_safe(req, tmp, &xprt->bc_pa_list, rq_bc_pa_list) {
202 spin_unlock_bh(&xprt->bc_pa_lock);
205 list_empty(&xprt->bc_pa_list) ? "true" : "false");
220 struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt)
225 spin_lock(&xprt->bc_pa_lock);
226 if (!list_empty(&xprt->bc_pa_list)) {
227 req = list_first_entry(&xprt->bc_pa_list, struct rpc_rqst,
233 spin_unlock(&xprt->bc_pa_lock);
252 struct rpc_xprt *xprt = req->rq_xprt;
261 if (!xprt_need_to_requeue(xprt)) {
277 spin_lock_bh(&xprt->bc_pa_lock);
278 list_add(&req->rq_bc_pa_list, &xprt->bc_pa_list);
279 spin_unlock_bh(&xprt->bc_pa_lock);