Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e00abc3 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: sunrpc should not explicitly depend on NFS config options



Change explicit references to CONFIG_NFS_V4_1 to implicit ones
Get rid of the unnecessary defines in backchannel_rqst.c and
bc_svc.c: the Makefile takes care of those dependency.

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 1f945357
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ config NFS_V4
config NFS_V4_1
	bool "NFS client support for NFSv4.1 (EXPERIMENTAL)"
	depends on NFS_FS && NFS_V4 && EXPERIMENTAL
	select SUNRPC_BACKCHANNEL
	select PNFS_FILE_LAYOUT
	help
	  This option enables support for minor version 1 of the NFSv4 protocol
+3 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <linux/sunrpc/xprt.h>
#include <linux/sunrpc/sched.h>

#ifdef CONFIG_NFS_V4_1
#ifdef CONFIG_SUNRPC_BACKCHANNEL
struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt);
void xprt_free_bc_request(struct rpc_rqst *req);
int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
@@ -47,7 +47,7 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
		return 1;
	return 0;
}
#else /* CONFIG_NFS_V4_1 */
#else /* CONFIG_SUNRPC_BACKCHANNEL */
static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
					 unsigned int min_reqs)
{
@@ -62,6 +62,6 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
static inline void xprt_free_bc_request(struct rpc_rqst *req)
{
}
#endif /* CONFIG_NFS_V4_1 */
#endif /* CONFIG_SUNRPC_BACKCHANNEL */
#endif /* _LINUX_SUNRPC_BC_XPRT_H */
+2 −2
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ struct svc_serv {
	struct module *		sv_module;	/* optional module to count when
						 * adding threads */
	svc_thread_fn		sv_function;	/* main function for threads */
#if defined(CONFIG_NFS_V4_1)
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
	struct list_head	sv_cb_list;	/* queue for callback requests
						 * that arrive over the same
						 * connection */
@@ -100,7 +100,7 @@ struct svc_serv {
	wait_queue_head_t	sv_cb_waitq;	/* sleep here if there are no
						 * entries in the svc_cb_list */
	struct svc_xprt		*sv_bc_xprt;	/* callback on fore channel */
#endif /* CONFIG_NFS_V4_1 */
#endif /* CONFIG_SUNRPC_BACKCHANNEL */
};

/*
+8 −8
Original line number Diff line number Diff line
@@ -100,11 +100,11 @@ struct rpc_rqst {
	ktime_t			rq_xtime;	/* transmit time stamp */
	int			rq_ntrans;

#if defined(CONFIG_NFS_V4_1)
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
	struct list_head	rq_bc_list;	/* Callback service list */
	unsigned long		rq_bc_pa_state;	/* Backchannel prealloc state */
	struct list_head	rq_bc_pa_list;	/* Backchannel prealloc list */
#endif /* CONFIG_NFS_V4_1 */
#endif /* CONFIG_SUNRPC_BACKCHANEL */
};
#define rq_svec			rq_snd_buf.head
#define rq_slen			rq_snd_buf.len
@@ -200,7 +200,7 @@ struct rpc_xprt {
	u32			xid;		/* Next XID value to use */
	struct rpc_task *	snd_task;	/* Task blocked in send */
	struct svc_xprt		*bc_xprt;	/* NFSv4.1 backchannel */
#if defined(CONFIG_NFS_V4_1)
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
	struct svc_serv		*bc_serv;       /* The RPC service which will */
						/* process the callback */
	unsigned int		bc_alloc_count;	/* Total number of preallocs */
@@ -208,7 +208,7 @@ struct rpc_xprt {
						 * items */
	struct list_head	bc_pa_list;	/* List of preallocated
						 * backchannel rpc_rqst's */
#endif /* CONFIG_NFS_V4_1 */
#endif /* CONFIG_SUNRPC_BACKCHANNEL */
	struct list_head	recv;

	struct {
@@ -228,15 +228,15 @@ struct rpc_xprt {
	const char		*address_strings[RPC_DISPLAY_MAX];
};

#if defined(CONFIG_NFS_V4_1)
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
/*
 * Backchannel flags
 */
#define	RPC_BC_PA_IN_USE	0x0001		/* Preallocated backchannel */
						/* buffer in use */
#endif /* CONFIG_NFS_V4_1 */
#endif /* CONFIG_SUNRPC_BACKCHANNEL */

#if defined(CONFIG_NFS_V4_1)
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
static inline int bc_prealloc(struct rpc_rqst *req)
{
	return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
@@ -246,7 +246,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
{
	return 0;
}
#endif /* CONFIG_NFS_V4_1 */
#endif /* CONFIG_SUNRPC_BACKCHANNEL */

struct xprt_create {
	int			ident;		/* XPRT_TRANSPORT identifier */
+4 −0
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@ config SUNRPC
config SUNRPC_GSS
	tristate

config SUNRPC_BACKCHANNEL
	bool
	depends on SUNRPC

config SUNRPC_XPRT_RDMA
	tristate
	depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL
Loading