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

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: Trond Myklebust <Trond.Myklebust@netapp.com>

+39 -40
+1
fs/nfs/Kconfig
··· 77 77 config NFS_V4_1 78 78 bool "NFS client support for NFSv4.1 (EXPERIMENTAL)" 79 79 depends on NFS_FS && NFS_V4 && EXPERIMENTAL 80 + select SUNRPC_BACKCHANNEL 80 81 select PNFS_FILE_LAYOUT 81 82 help 82 83 This option enables support for minor version 1 of the NFSv4 protocol
+3 -3
include/linux/sunrpc/bc_xprt.h
··· 31 31 #include <linux/sunrpc/xprt.h> 32 32 #include <linux/sunrpc/sched.h> 33 33 34 - #ifdef CONFIG_NFS_V4_1 34 + #ifdef CONFIG_SUNRPC_BACKCHANNEL 35 35 struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); 36 36 void xprt_free_bc_request(struct rpc_rqst *req); 37 37 int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); ··· 47 47 return 1; 48 48 return 0; 49 49 } 50 - #else /* CONFIG_NFS_V4_1 */ 50 + #else /* CONFIG_SUNRPC_BACKCHANNEL */ 51 51 static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, 52 52 unsigned int min_reqs) 53 53 { ··· 62 62 static inline void xprt_free_bc_request(struct rpc_rqst *req) 63 63 { 64 64 } 65 - #endif /* CONFIG_NFS_V4_1 */ 65 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 66 66 #endif /* _LINUX_SUNRPC_BC_XPRT_H */ 67 67
+2 -2
include/linux/sunrpc/svc.h
··· 92 92 struct module * sv_module; /* optional module to count when 93 93 * adding threads */ 94 94 svc_thread_fn sv_function; /* main function for threads */ 95 - #if defined(CONFIG_NFS_V4_1) 95 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 96 96 struct list_head sv_cb_list; /* queue for callback requests 97 97 * that arrive over the same 98 98 * connection */ ··· 100 100 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no 101 101 * entries in the svc_cb_list */ 102 102 struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ 103 - #endif /* CONFIG_NFS_V4_1 */ 103 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 104 104 }; 105 105 106 106 /*
+8 -8
include/linux/sunrpc/xprt.h
··· 100 100 ktime_t rq_xtime; /* transmit time stamp */ 101 101 int rq_ntrans; 102 102 103 - #if defined(CONFIG_NFS_V4_1) 103 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 104 104 struct list_head rq_bc_list; /* Callback service list */ 105 105 unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ 106 106 struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ 107 - #endif /* CONFIG_NFS_V4_1 */ 107 + #endif /* CONFIG_SUNRPC_BACKCHANEL */ 108 108 }; 109 109 #define rq_svec rq_snd_buf.head 110 110 #define rq_slen rq_snd_buf.len ··· 200 200 u32 xid; /* Next XID value to use */ 201 201 struct rpc_task * snd_task; /* Task blocked in send */ 202 202 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ 203 - #if defined(CONFIG_NFS_V4_1) 203 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 204 204 struct svc_serv *bc_serv; /* The RPC service which will */ 205 205 /* process the callback */ 206 206 unsigned int bc_alloc_count; /* Total number of preallocs */ ··· 208 208 * items */ 209 209 struct list_head bc_pa_list; /* List of preallocated 210 210 * backchannel rpc_rqst's */ 211 - #endif /* CONFIG_NFS_V4_1 */ 211 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 212 212 struct list_head recv; 213 213 214 214 struct { ··· 228 228 const char *address_strings[RPC_DISPLAY_MAX]; 229 229 }; 230 230 231 - #if defined(CONFIG_NFS_V4_1) 231 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 232 232 /* 233 233 * Backchannel flags 234 234 */ 235 235 #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ 236 236 /* buffer in use */ 237 - #endif /* CONFIG_NFS_V4_1 */ 237 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 238 238 239 - #if defined(CONFIG_NFS_V4_1) 239 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 240 240 static inline int bc_prealloc(struct rpc_rqst *req) 241 241 { 242 242 return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); ··· 246 246 { 247 247 return 0; 248 248 } 249 - #endif /* CONFIG_NFS_V4_1 */ 249 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 250 250 251 251 struct xprt_create { 252 252 int ident; /* XPRT_TRANSPORT identifier */
+4
net/sunrpc/Kconfig
··· 4 4 config SUNRPC_GSS 5 5 tristate 6 6 7 + config SUNRPC_BACKCHANNEL 8 + bool 9 + depends on SUNRPC 10 + 7 11 config SUNRPC_XPRT_RDMA 8 12 tristate 9 13 depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL
+1 -1
net/sunrpc/Makefile
··· 13 13 addr.o rpcb_clnt.o timer.o xdr.o \ 14 14 sunrpc_syms.o cache.o rpc_pipe.o \ 15 15 svc_xprt.o 16 - sunrpc-$(CONFIG_NFS_V4_1) += backchannel_rqst.o bc_svc.o 16 + sunrpc-$(CONFIG_SUNRPC_BACKCHANNEL) += backchannel_rqst.o bc_svc.o 17 17 sunrpc-$(CONFIG_PROC_FS) += stats.o 18 18 sunrpc-$(CONFIG_SYSCTL) += sysctl.o
-3
net/sunrpc/backchannel_rqst.c
··· 29 29 #define RPCDBG_FACILITY RPCDBG_TRANS 30 30 #endif 31 31 32 - #if defined(CONFIG_NFS_V4_1) 33 - 34 32 /* 35 33 * Helper routines that track the number of preallocation elements 36 34 * on the transport. ··· 277 279 spin_unlock_bh(&xprt->bc_pa_lock); 278 280 } 279 281 280 - #endif /* CONFIG_NFS_V4_1 */
-3
net/sunrpc/bc_svc.c
··· 27 27 * reply over an existing open connection previously established by the client. 28 28 */ 29 29 30 - #if defined(CONFIG_NFS_V4_1) 31 - 32 30 #include <linux/module.h> 33 31 34 32 #include <linux/sunrpc/xprt.h> ··· 61 63 return ret; 62 64 } 63 65 64 - #endif /* CONFIG_NFS_V4_1 */
+6 -6
net/sunrpc/clnt.c
··· 64 64 static void call_bind(struct rpc_task *task); 65 65 static void call_bind_status(struct rpc_task *task); 66 66 static void call_transmit(struct rpc_task *task); 67 - #if defined(CONFIG_NFS_V4_1) 67 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 68 68 static void call_bc_transmit(struct rpc_task *task); 69 - #endif /* CONFIG_NFS_V4_1 */ 69 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 70 70 static void call_status(struct rpc_task *task); 71 71 static void call_transmit_status(struct rpc_task *task); 72 72 static void call_refresh(struct rpc_task *task); ··· 716 716 } 717 717 EXPORT_SYMBOL_GPL(rpc_call_async); 718 718 719 - #if defined(CONFIG_NFS_V4_1) 719 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 720 720 /** 721 721 * rpc_run_bc_task - Allocate a new RPC task for backchannel use, then run 722 722 * rpc_execute against it ··· 759 759 dprintk("RPC: rpc_run_bc_task: task= %p\n", task); 760 760 return task; 761 761 } 762 - #endif /* CONFIG_NFS_V4_1 */ 762 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 763 763 764 764 void 765 765 rpc_call_start(struct rpc_task *task) ··· 1362 1362 } 1363 1363 } 1364 1364 1365 - #if defined(CONFIG_NFS_V4_1) 1365 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1366 1366 /* 1367 1367 * 5b. Send the backchannel RPC reply. On error, drop the reply. In 1368 1368 * addition, disconnect on connectivity errors. ··· 1426 1426 } 1427 1427 rpc_wake_up_queued_task(&req->rq_xprt->pending, task); 1428 1428 } 1429 - #endif /* CONFIG_NFS_V4_1 */ 1429 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 1430 1430 1431 1431 /* 1432 1432 * 6. Sort out the RPC call status
+2 -2
net/sunrpc/svc.c
··· 1252 1252 } 1253 1253 } 1254 1254 1255 - #if defined(CONFIG_NFS_V4_1) 1255 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1256 1256 /* 1257 1257 * Process a backchannel RPC request that arrived over an existing 1258 1258 * outbound connection ··· 1301 1301 } 1302 1302 } 1303 1303 EXPORT_SYMBOL(bc_svc_process); 1304 - #endif /* CONFIG_NFS_V4_1 */ 1304 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 1305 1305 1306 1306 /* 1307 1307 * Return (transport-specific) limit on the rpc payload.
+7 -7
net/sunrpc/svcsock.c
··· 66 66 static struct svc_xprt *svc_create_socket(struct svc_serv *, int, 67 67 struct net *, struct sockaddr *, 68 68 int, int); 69 - #if defined(CONFIG_NFS_V4_1) 69 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 70 70 static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, 71 71 struct net *, struct sockaddr *, 72 72 int, int); 73 73 static void svc_bc_sock_free(struct svc_xprt *xprt); 74 - #endif /* CONFIG_NFS_V4_1 */ 74 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 75 75 76 76 #ifdef CONFIG_DEBUG_LOCK_ALLOC 77 77 static struct lock_class_key svc_key[2]; ··· 1241 1241 return svc_create_socket(serv, IPPROTO_TCP, net, sa, salen, flags); 1242 1242 } 1243 1243 1244 - #if defined(CONFIG_NFS_V4_1) 1244 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1245 1245 static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, 1246 1246 struct net *, struct sockaddr *, 1247 1247 int, int); ··· 1282 1282 { 1283 1283 svc_unreg_xprt_class(&svc_tcp_bc_class); 1284 1284 } 1285 - #else /* CONFIG_NFS_V4_1 */ 1285 + #else /* CONFIG_SUNRPC_BACKCHANNEL */ 1286 1286 static void svc_init_bc_xprt_sock(void) 1287 1287 { 1288 1288 } ··· 1290 1290 static void svc_cleanup_bc_xprt_sock(void) 1291 1291 { 1292 1292 } 1293 - #endif /* CONFIG_NFS_V4_1 */ 1293 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 1294 1294 1295 1295 static struct svc_xprt_ops svc_tcp_ops = { 1296 1296 .xpo_create = svc_tcp_create, ··· 1621 1621 kfree(svsk); 1622 1622 } 1623 1623 1624 - #if defined(CONFIG_NFS_V4_1) 1624 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1625 1625 /* 1626 1626 * Create a back channel svc_xprt which shares the fore channel socket. 1627 1627 */ ··· 1660 1660 if (xprt) 1661 1661 kfree(container_of(xprt, struct svc_sock, sk_xprt)); 1662 1662 } 1663 - #endif /* CONFIG_NFS_V4_1 */ 1663 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */
+2 -2
net/sunrpc/xprt.c
··· 1111 1111 1112 1112 INIT_LIST_HEAD(&xprt->free); 1113 1113 INIT_LIST_HEAD(&xprt->recv); 1114 - #if defined(CONFIG_NFS_V4_1) 1114 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1115 1115 spin_lock_init(&xprt->bc_pa_lock); 1116 1116 INIT_LIST_HEAD(&xprt->bc_pa_list); 1117 - #endif /* CONFIG_NFS_V4_1 */ 1117 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 1118 1118 1119 1119 INIT_WORK(&xprt->task_cleanup, xprt_autoclose); 1120 1120 if (xprt_has_timer(xprt))
+3 -3
net/sunrpc/xprtsock.c
··· 37 37 #include <linux/sunrpc/svcsock.h> 38 38 #include <linux/sunrpc/xprtsock.h> 39 39 #include <linux/file.h> 40 - #ifdef CONFIG_NFS_V4_1 40 + #ifdef CONFIG_SUNRPC_BACKCHANNEL 41 41 #include <linux/sunrpc/bc_xprt.h> 42 42 #endif 43 43 ··· 1236 1236 return 0; 1237 1237 } 1238 1238 1239 - #if defined(CONFIG_NFS_V4_1) 1239 + #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1240 1240 /* 1241 1241 * Obtains an rpc_rqst previously allocated and invokes the common 1242 1242 * tcp read code to read the data. The result is placed in the callback ··· 1299 1299 { 1300 1300 return xs_tcp_read_reply(xprt, desc); 1301 1301 } 1302 - #endif /* CONFIG_NFS_V4_1 */ 1302 + #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 1303 1303 1304 1304 /* 1305 1305 * Read data off the transport. This can be either an RPC_CALL or an