0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef _LINUX_SUNRPC_BC_XPRT_H
0014 #define _LINUX_SUNRPC_BC_XPRT_H
0015
0016 #include <linux/sunrpc/svcsock.h>
0017 #include <linux/sunrpc/xprt.h>
0018 #include <linux/sunrpc/sched.h>
0019
0020 #ifdef CONFIG_SUNRPC_BACKCHANNEL
0021 struct rpc_rqst *xprt_lookup_bc_request(struct rpc_xprt *xprt, __be32 xid);
0022 void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied);
0023 void xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task);
0024 void xprt_free_bc_request(struct rpc_rqst *req);
0025 int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
0026 void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs);
0027
0028
0029 int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs);
0030 void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs);
0031 void xprt_free_bc_rqst(struct rpc_rqst *req);
0032 unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt);
0033
0034
0035
0036
0037 static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
0038 {
0039 return rqstp->rq_server->sv_bc_enabled;
0040 }
0041
0042 static inline void set_bc_enabled(struct svc_serv *serv)
0043 {
0044 serv->sv_bc_enabled = true;
0045 }
0046 #else
0047 static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
0048 unsigned int min_reqs)
0049 {
0050 return 0;
0051 }
0052
0053 static inline void xprt_destroy_backchannel(struct rpc_xprt *xprt,
0054 unsigned int max_reqs)
0055 {
0056 }
0057
0058 static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
0059 {
0060 return false;
0061 }
0062
0063 static inline void set_bc_enabled(struct svc_serv *serv)
0064 {
0065 }
0066
0067 static inline void xprt_free_bc_request(struct rpc_rqst *req)
0068 {
0069 }
0070 #endif
0071 #endif