[RFC PATCH 8/9] sunrpc: add Kconfig option for CONFIG_SUNRPC_SMB

Jeff Layton <[email protected]>
Newsgroups gmane.linux.nfs,gmane.linux.file-systems.cifs
Message-ID <[email protected]>
...and the necessary Makefile bits so to compile support into the sunrpc
module.

Signed-off-by: Jeff Layton <[email protected]>
---
 net/sunrpc/Kconfig       |   11 +++++++++++
 net/sunrpc/Makefile      |    1 +
 net/sunrpc/sunrpc_syms.c |    3 +++
 net/sunrpc/xprtsmb.c     |    7 +++++--
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
index 443c161..63f5ee7 100644
--- a/net/sunrpc/Kconfig
+++ b/net/sunrpc/Kconfig
@@ -54,3 +54,14 @@ config RPCSEC_GSS_SPKM3
 	  available from http://linux-nfs.org/.
 
 	  If unsure, say N.
+
+config SUNRPC_SMB
+	bool "SMB/CIFS Transport for the SUNRPC Layer (EXPERIMENTAL)"
+	depends on SUNRPC && EXPERIMENTAL
+	help
+	    This option adds the ability for the kernels SUNRPC Layer to
+	    send and receive Sever Message Block (SMB) traffic. This
+	    protocol is widely used by Microsoft Windows servers for
+	    filesharing.
+
+	    If unsure, say N.
diff --git a/net/sunrpc/Makefile b/net/sunrpc/Makefile
index 9d2fca5..691e62f 100644
--- a/net/sunrpc/Makefile
+++ b/net/sunrpc/Makefile
@@ -16,3 +16,4 @@ sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \
 sunrpc-$(CONFIG_NFS_V4_1) += backchannel_rqst.o bc_svc.o
 sunrpc-$(CONFIG_PROC_FS) += stats.o
 sunrpc-$(CONFIG_SYSCTL) += sysctl.o
+sunrpc-$(CONFIG_SUNRPC_SMB) += xprtsmb.o smb.o
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index 8cce921..65b4dec 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -21,6 +21,7 @@
 #include <linux/workqueue.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
 #include <linux/sunrpc/xprtsock.h>
+#include <linux/sunrpc/xprtsmb.h>
 
 extern struct cache_detail ip_map_cache, unix_gid_cache;
 
@@ -45,6 +46,7 @@ init_sunrpc(void)
 	cache_register(&unix_gid_cache);
 	svc_init_xprt_sock();	/* svc sock transport */
 	init_socket_xprt();	/* clnt sock transport */
+	init_smb_xprt();
 	rpcauth_init_module();
 out:
 	return err;
@@ -54,6 +56,7 @@ static void __exit
 cleanup_sunrpc(void)
 {
 	rpcauth_remove_module();
+	cleanup_smb_xprt();
 	cleanup_socket_xprt();
 	svc_cleanup_xprt_sock();
 	unregister_rpc_pipefs();
diff --git a/net/sunrpc/xprtsmb.c b/net/sunrpc/xprtsmb.c
index 585cf37..362600a 100644
--- a/net/sunrpc/xprtsmb.c
+++ b/net/sunrpc/xprtsmb.c
@@ -1691,7 +1691,8 @@ static struct xprt_class	xs_smb_transport = {
  * init_socket_xprt - set up xprtsock's sysctls, register with RPC client
  *
  */
-int init_smb_xprt(void)
+int
+init_smb_xprt(void)
 {
 #ifdef RPC_DEBUG
 	if (!sunrpc_table_header)
@@ -1707,7 +1708,8 @@ int init_smb_xprt(void)
  * cleanup_socket_xprt - remove xprtsock's sysctls, unregister
  *
  */
-void cleanup_smb_xprt(void)
+void
+cleanup_smb_xprt(void)
 {
 #ifdef RPC_DEBUG
 	if (sunrpc_table_header) {
@@ -1718,3 +1720,4 @@ void cleanup_smb_xprt(void)
 
 	xprt_unregister_transport(&xs_smb_transport);
 }
+
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.