hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/sunrpc/bc_xprt.h
....@@ -4,7 +4,7 @@
44
55 NetApp provides this source code under the GPL v2 License.
66 The GPL v2 license is available at
7
-http://opensource.org/licenses/gpl-license.php.
7
+https://opensource.org/licenses/gpl-license.php.
88
99 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1010 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
....@@ -34,6 +34,7 @@
3434 #ifdef CONFIG_SUNRPC_BACKCHANNEL
3535 struct rpc_rqst *xprt_lookup_bc_request(struct rpc_xprt *xprt, __be32 xid);
3636 void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied);
37
+void xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task);
3738 void xprt_free_bc_request(struct rpc_rqst *req);
3839 int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
3940 void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs);
....@@ -42,15 +43,19 @@
4243 int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs);
4344 void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs);
4445 void xprt_free_bc_rqst(struct rpc_rqst *req);
46
+unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt);
4547
4648 /*
4749 * Determine if a shared backchannel is in use
4850 */
49
-static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
51
+static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
5052 {
51
- if (rqstp->rq_server->sv_bc_xprt)
52
- return 1;
53
- return 0;
53
+ return rqstp->rq_server->sv_bc_enabled;
54
+}
55
+
56
+static inline void set_bc_enabled(struct svc_serv *serv)
57
+{
58
+ serv->sv_bc_enabled = true;
5459 }
5560 #else /* CONFIG_SUNRPC_BACKCHANNEL */
5661 static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
....@@ -59,9 +64,18 @@
5964 return 0;
6065 }
6166
62
-static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
67
+static inline void xprt_destroy_backchannel(struct rpc_xprt *xprt,
68
+ unsigned int max_reqs)
6369 {
64
- return 0;
70
+}
71
+
72
+static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
73
+{
74
+ return false;
75
+}
76
+
77
+static inline void set_bc_enabled(struct svc_serv *serv)
78
+{
6579 }
6680
6781 static inline void xprt_free_bc_request(struct rpc_rqst *req)