diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-13 19:20:49 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-15 09:12:23 -0400 |
commit | 9e00abc3c20904fd6a5d888bb7023925799ec8a5 (patch) | |
tree | ea6f8749fa21e5b23f02b36c3a82e405b495af0b /net/sunrpc | |
parent | 1f9453578f059d2651aa6c6b16756627fc9f2a74 (diff) |
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>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/Kconfig | 4 | ||||
-rw-r--r-- | net/sunrpc/Makefile | 2 | ||||
-rw-r--r-- | net/sunrpc/backchannel_rqst.c | 3 | ||||
-rw-r--r-- | net/sunrpc/bc_svc.c | 3 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 12 | ||||
-rw-r--r-- | net/sunrpc/svc.c | 4 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 14 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 6 |
9 files changed, 25 insertions, 27 deletions
diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig index b2198e65d8bb..ffd243d09188 100644 --- a/net/sunrpc/Kconfig +++ b/net/sunrpc/Kconfig | |||
@@ -4,6 +4,10 @@ config SUNRPC | |||
4 | config SUNRPC_GSS | 4 | config SUNRPC_GSS |
5 | tristate | 5 | tristate |
6 | 6 | ||
7 | config SUNRPC_BACKCHANNEL | ||
8 | bool | ||
9 | depends on SUNRPC | ||
10 | |||
7 | config SUNRPC_XPRT_RDMA | 11 | config SUNRPC_XPRT_RDMA |
8 | tristate | 12 | tristate |
9 | depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL | 13 | depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL |
diff --git a/net/sunrpc/Makefile b/net/sunrpc/Makefile index 9d2fca5ad14a..8209a0411bca 100644 --- a/net/sunrpc/Makefile +++ b/net/sunrpc/Makefile | |||
@@ -13,6 +13,6 @@ sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \ | |||
13 | addr.o rpcb_clnt.o timer.o xdr.o \ | 13 | addr.o rpcb_clnt.o timer.o xdr.o \ |
14 | sunrpc_syms.o cache.o rpc_pipe.o \ | 14 | sunrpc_syms.o cache.o rpc_pipe.o \ |
15 | svc_xprt.o | 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 | sunrpc-$(CONFIG_PROC_FS) += stats.o | 17 | sunrpc-$(CONFIG_PROC_FS) += stats.o |
18 | sunrpc-$(CONFIG_SYSCTL) += sysctl.o | 18 | sunrpc-$(CONFIG_SYSCTL) += sysctl.o |
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c index cf06af3b63c6..bb5593f467cb 100644 --- a/net/sunrpc/backchannel_rqst.c +++ b/net/sunrpc/backchannel_rqst.c | |||
@@ -29,8 +29,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
29 | #define RPCDBG_FACILITY RPCDBG_TRANS | 29 | #define RPCDBG_FACILITY RPCDBG_TRANS |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #if defined(CONFIG_NFS_V4_1) | ||
33 | |||
34 | /* | 32 | /* |
35 | * Helper routines that track the number of preallocation elements | 33 | * Helper routines that track the number of preallocation elements |
36 | * on the transport. | 34 | * on the transport. |
@@ -279,4 +277,3 @@ void xprt_free_bc_request(struct rpc_rqst *req) | |||
279 | spin_unlock_bh(&xprt->bc_pa_lock); | 277 | spin_unlock_bh(&xprt->bc_pa_lock); |
280 | } | 278 | } |
281 | 279 | ||
282 | #endif /* CONFIG_NFS_V4_1 */ | ||
diff --git a/net/sunrpc/bc_svc.c b/net/sunrpc/bc_svc.c index 1dd1a6890007..0b2eb388cbda 100644 --- a/net/sunrpc/bc_svc.c +++ b/net/sunrpc/bc_svc.c | |||
@@ -27,8 +27,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
27 | * reply over an existing open connection previously established by the client. | 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 | #include <linux/module.h> | 30 | #include <linux/module.h> |
33 | 31 | ||
34 | #include <linux/sunrpc/xprt.h> | 32 | #include <linux/sunrpc/xprt.h> |
@@ -63,4 +61,3 @@ int bc_send(struct rpc_rqst *req) | |||
63 | return ret; | 61 | return ret; |
64 | } | 62 | } |
65 | 63 | ||
66 | #endif /* CONFIG_NFS_V4_1 */ | ||
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 64c3fe11aff6..d3fe866f57ac 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -64,9 +64,9 @@ static void call_decode(struct rpc_task *task); | |||
64 | static void call_bind(struct rpc_task *task); | 64 | static void call_bind(struct rpc_task *task); |
65 | static void call_bind_status(struct rpc_task *task); | 65 | static void call_bind_status(struct rpc_task *task); |
66 | static void call_transmit(struct rpc_task *task); | 66 | static void call_transmit(struct rpc_task *task); |
67 | #if defined(CONFIG_NFS_V4_1) | 67 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
68 | static void call_bc_transmit(struct rpc_task *task); | 68 | static void call_bc_transmit(struct rpc_task *task); |
69 | #endif /* CONFIG_NFS_V4_1 */ | 69 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
70 | static void call_status(struct rpc_task *task); | 70 | static void call_status(struct rpc_task *task); |
71 | static void call_transmit_status(struct rpc_task *task); | 71 | static void call_transmit_status(struct rpc_task *task); |
72 | static void call_refresh(struct rpc_task *task); | 72 | static void call_refresh(struct rpc_task *task); |
@@ -716,7 +716,7 @@ rpc_call_async(struct rpc_clnt *clnt, const struct rpc_message *msg, int flags, | |||
716 | } | 716 | } |
717 | EXPORT_SYMBOL_GPL(rpc_call_async); | 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 | * rpc_run_bc_task - Allocate a new RPC task for backchannel use, then run | 721 | * rpc_run_bc_task - Allocate a new RPC task for backchannel use, then run |
722 | * rpc_execute against it | 722 | * rpc_execute against it |
@@ -759,7 +759,7 @@ out: | |||
759 | dprintk("RPC: rpc_run_bc_task: task= %p\n", task); | 759 | dprintk("RPC: rpc_run_bc_task: task= %p\n", task); |
760 | return task; | 760 | return task; |
761 | } | 761 | } |
762 | #endif /* CONFIG_NFS_V4_1 */ | 762 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
763 | 763 | ||
764 | void | 764 | void |
765 | rpc_call_start(struct rpc_task *task) | 765 | rpc_call_start(struct rpc_task *task) |
@@ -1362,7 +1362,7 @@ call_transmit_status(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 | * 5b. Send the backchannel RPC reply. On error, drop the reply. In | 1367 | * 5b. Send the backchannel RPC reply. On error, drop the reply. In |
1368 | * addition, disconnect on connectivity errors. | 1368 | * addition, disconnect on connectivity errors. |
@@ -1426,7 +1426,7 @@ call_bc_transmit(struct rpc_task *task) | |||
1426 | } | 1426 | } |
1427 | rpc_wake_up_queued_task(&req->rq_xprt->pending, task); | 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 | * 6. Sort out the RPC call status | 1432 | * 6. Sort out the RPC call status |
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 2b90292e9505..3c6fe222dec6 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -1252,7 +1252,7 @@ svc_process(struct svc_rqst *rqstp) | |||
1252 | } | 1252 | } |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | #if defined(CONFIG_NFS_V4_1) | 1255 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
1256 | /* | 1256 | /* |
1257 | * Process a backchannel RPC request that arrived over an existing | 1257 | * Process a backchannel RPC request that arrived over an existing |
1258 | * outbound connection | 1258 | * outbound connection |
@@ -1301,7 +1301,7 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req, | |||
1301 | } | 1301 | } |
1302 | } | 1302 | } |
1303 | EXPORT_SYMBOL(bc_svc_process); | 1303 | EXPORT_SYMBOL(bc_svc_process); |
1304 | #endif /* CONFIG_NFS_V4_1 */ | 1304 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
1305 | 1305 | ||
1306 | /* | 1306 | /* |
1307 | * Return (transport-specific) limit on the rpc payload. | 1307 | * Return (transport-specific) limit on the rpc payload. |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index af04f779ce9f..a1812a295388 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -66,12 +66,12 @@ static void svc_sock_free(struct svc_xprt *); | |||
66 | static struct svc_xprt *svc_create_socket(struct svc_serv *, int, | 66 | static struct svc_xprt *svc_create_socket(struct svc_serv *, int, |
67 | struct net *, struct sockaddr *, | 67 | struct net *, struct sockaddr *, |
68 | int, int); | 68 | int, int); |
69 | #if defined(CONFIG_NFS_V4_1) | 69 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
70 | static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, | 70 | static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, |
71 | struct net *, struct sockaddr *, | 71 | struct net *, struct sockaddr *, |
72 | int, int); | 72 | int, int); |
73 | static void svc_bc_sock_free(struct svc_xprt *xprt); | 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 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 76 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
77 | static struct lock_class_key svc_key[2]; | 77 | static struct lock_class_key svc_key[2]; |
@@ -1241,7 +1241,7 @@ static struct svc_xprt *svc_tcp_create(struct svc_serv *serv, | |||
1241 | return svc_create_socket(serv, IPPROTO_TCP, net, sa, salen, flags); | 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 | static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, | 1245 | static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, |
1246 | struct net *, struct sockaddr *, | 1246 | struct net *, struct sockaddr *, |
1247 | int, int); | 1247 | int, int); |
@@ -1282,7 +1282,7 @@ static void svc_cleanup_bc_xprt_sock(void) | |||
1282 | { | 1282 | { |
1283 | svc_unreg_xprt_class(&svc_tcp_bc_class); | 1283 | svc_unreg_xprt_class(&svc_tcp_bc_class); |
1284 | } | 1284 | } |
1285 | #else /* CONFIG_NFS_V4_1 */ | 1285 | #else /* CONFIG_SUNRPC_BACKCHANNEL */ |
1286 | static void svc_init_bc_xprt_sock(void) | 1286 | static void svc_init_bc_xprt_sock(void) |
1287 | { | 1287 | { |
1288 | } | 1288 | } |
@@ -1290,7 +1290,7 @@ static void svc_init_bc_xprt_sock(void) | |||
1290 | static void svc_cleanup_bc_xprt_sock(void) | 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 | static struct svc_xprt_ops svc_tcp_ops = { | 1295 | static struct svc_xprt_ops svc_tcp_ops = { |
1296 | .xpo_create = svc_tcp_create, | 1296 | .xpo_create = svc_tcp_create, |
@@ -1621,7 +1621,7 @@ static void svc_sock_free(struct svc_xprt *xprt) | |||
1621 | kfree(svsk); | 1621 | kfree(svsk); |
1622 | } | 1622 | } |
1623 | 1623 | ||
1624 | #if defined(CONFIG_NFS_V4_1) | 1624 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
1625 | /* | 1625 | /* |
1626 | * Create a back channel svc_xprt which shares the fore channel socket. | 1626 | * Create a back channel svc_xprt which shares the fore channel socket. |
1627 | */ | 1627 | */ |
@@ -1660,4 +1660,4 @@ static void svc_bc_sock_free(struct svc_xprt *xprt) | |||
1660 | if (xprt) | 1660 | if (xprt) |
1661 | kfree(container_of(xprt, struct svc_sock, sk_xprt)); | 1661 | kfree(container_of(xprt, struct svc_sock, sk_xprt)); |
1662 | } | 1662 | } |
1663 | #endif /* CONFIG_NFS_V4_1 */ | 1663 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index ce5eb68a9664..fbdbaf2cd58d 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -1111,10 +1111,10 @@ found: | |||
1111 | 1111 | ||
1112 | INIT_LIST_HEAD(&xprt->free); | 1112 | INIT_LIST_HEAD(&xprt->free); |
1113 | INIT_LIST_HEAD(&xprt->recv); | 1113 | INIT_LIST_HEAD(&xprt->recv); |
1114 | #if defined(CONFIG_NFS_V4_1) | 1114 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
1115 | spin_lock_init(&xprt->bc_pa_lock); | 1115 | spin_lock_init(&xprt->bc_pa_lock); |
1116 | INIT_LIST_HEAD(&xprt->bc_pa_list); | 1116 | INIT_LIST_HEAD(&xprt->bc_pa_list); |
1117 | #endif /* CONFIG_NFS_V4_1 */ | 1117 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
1118 | 1118 | ||
1119 | INIT_WORK(&xprt->task_cleanup, xprt_autoclose); | 1119 | INIT_WORK(&xprt->task_cleanup, xprt_autoclose); |
1120 | if (xprt_has_timer(xprt)) | 1120 | if (xprt_has_timer(xprt)) |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 72abb7358933..cd6c410fa8fa 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <linux/sunrpc/svcsock.h> | 37 | #include <linux/sunrpc/svcsock.h> |
38 | #include <linux/sunrpc/xprtsock.h> | 38 | #include <linux/sunrpc/xprtsock.h> |
39 | #include <linux/file.h> | 39 | #include <linux/file.h> |
40 | #ifdef CONFIG_NFS_V4_1 | 40 | #ifdef CONFIG_SUNRPC_BACKCHANNEL |
41 | #include <linux/sunrpc/bc_xprt.h> | 41 | #include <linux/sunrpc/bc_xprt.h> |
42 | #endif | 42 | #endif |
43 | 43 | ||
@@ -1236,7 +1236,7 @@ static inline int xs_tcp_read_reply(struct rpc_xprt *xprt, | |||
1236 | return 0; | 1236 | return 0; |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | #if defined(CONFIG_NFS_V4_1) | 1239 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
1240 | /* | 1240 | /* |
1241 | * Obtains an rpc_rqst previously allocated and invokes the common | 1241 | * Obtains an rpc_rqst previously allocated and invokes the common |
1242 | * tcp read code to read the data. The result is placed in the callback | 1242 | * tcp read code to read the data. The result is placed in the callback |
@@ -1299,7 +1299,7 @@ static inline int _xs_tcp_read_data(struct rpc_xprt *xprt, | |||
1299 | { | 1299 | { |
1300 | return xs_tcp_read_reply(xprt, desc); | 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 | * Read data off the transport. This can be either an RPC_CALL or an | 1305 | * Read data off the transport. This can be either an RPC_CALL or an |