@@ -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.
@@ -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
@@ -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();
@@ -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);
}
+
...and the necessary Makefile bits so to compile support into the sunrpc module. Signed-off-by: Jeff Layton <jlayton@redhat.com> --- 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(-)