Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

SUNRPC: new helper function for stopping backchannel server

Create a new backchannel function to stop the backchannel server
and clear the bc_serv in transport protected under the bc_pa_lock.

Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Olga Kornievskaia and committed by
Trond Myklebust
6f8b26c9 441244d4

+22
+6
include/linux/sunrpc/bc_xprt.h
··· 32 32 void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs); 33 33 void xprt_free_bc_rqst(struct rpc_rqst *req); 34 34 unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt); 35 + void xprt_svc_destroy_nullify_bc(struct rpc_xprt *xprt, struct svc_serv **serv); 35 36 36 37 /* 37 38 * Determine if a shared backchannel is in use ··· 69 68 70 69 static inline void xprt_free_bc_request(struct rpc_rqst *req) 71 70 { 71 + } 72 + 73 + static inline void xprt_svc_destroy_nullify_bc(struct rpc_xprt *xprt, struct svc_serv **serv) 74 + { 75 + svc_destroy(serv); 72 76 } 73 77 #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 74 78 #endif /* _LINUX_SUNRPC_BC_XPRT_H */
+16
net/sunrpc/backchannel_rqst.c
··· 25 25 } 26 26 27 27 /* 28 + * Helper function to nullify backchannel server pointer in transport. 29 + * We need to synchronize setting the pointer to NULL (done so after 30 + * the backchannel server is shutdown) with the usage of that pointer 31 + * by the backchannel request processing routines 32 + * xprt_complete_bc_request() and rpcrdma_bc_receive_call(). 33 + */ 34 + void xprt_svc_destroy_nullify_bc(struct rpc_xprt *xprt, struct svc_serv **serv) 35 + { 36 + spin_lock(&xprt->bc_pa_lock); 37 + svc_destroy(serv); 38 + xprt->bc_serv = NULL; 39 + spin_unlock(&xprt->bc_pa_lock); 40 + } 41 + EXPORT_SYMBOL_GPL(xprt_svc_destroy_nullify_bc); 42 + 43 + /* 28 44 * Helper routines that track the number of preallocation elements 29 45 * on the transport. 30 46 */