Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0-only */
2/******************************************************************************
3
4(c) 2008 NetApp. All Rights Reserved.
5
6
7******************************************************************************/
8
9/*
10 * Functions to create and manage the backchannel
11 */
12
13#ifndef _LINUX_SUNRPC_BC_XPRT_H
14#define _LINUX_SUNRPC_BC_XPRT_H
15
16#include <linux/sunrpc/svcsock.h>
17#include <linux/sunrpc/xprt.h>
18#include <linux/sunrpc/sched.h>
19
20#ifdef CONFIG_SUNRPC_BACKCHANNEL
21struct rpc_rqst *xprt_lookup_bc_request(struct rpc_xprt *xprt, __be32 xid);
22void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied);
23void xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task);
24void xprt_free_bc_request(struct rpc_rqst *req);
25int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
26void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs);
27
28/* Socket backchannel transport methods */
29int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs);
30void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs);
31void xprt_free_bc_rqst(struct rpc_rqst *req);
32unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt);
33
34/*
35 * Determine if a shared backchannel is in use
36 */
37static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
38{
39 return rqstp->rq_server->sv_bc_enabled;
40}
41
42static inline void set_bc_enabled(struct svc_serv *serv)
43{
44 serv->sv_bc_enabled = true;
45}
46#else /* CONFIG_SUNRPC_BACKCHANNEL */
47static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
48 unsigned int min_reqs)
49{
50 return 0;
51}
52
53static inline void xprt_destroy_backchannel(struct rpc_xprt *xprt,
54 unsigned int max_reqs)
55{
56}
57
58static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
59{
60 return false;
61}
62
63static inline void set_bc_enabled(struct svc_serv *serv)
64{
65}
66
67static inline void xprt_free_bc_request(struct rpc_rqst *req)
68{
69}
70#endif /* CONFIG_SUNRPC_BACKCHANNEL */
71#endif /* _LINUX_SUNRPC_BC_XPRT_H */