aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorOlaf Kirch <okir@suse.de>2006-03-20 13:44:08 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:08 -0500
commitf344f6df4b2baa3e5c553c461735dfaf92f44be7 (patch)
treebf8acb09763c5f5f87d8c23047b8ecbb826dd385 /net/sunrpc
parentfb374d24f225f38f13dbffb65dd7ec72daf08dba (diff)
SUNRPC: Auto-load RPC authentication kernel modules
This patch adds a request_module call to rpcauth_create which will try to auto-load the kernel module for the requested authentication flavor. For kernels with modular sunrpc, this reduces the admin overhead for the user. Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 8d6f1a176b15..55163af3dcaf 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -64,14 +64,26 @@ rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt)
64 struct rpc_authops *ops; 64 struct rpc_authops *ops;
65 u32 flavor = pseudoflavor_to_flavor(pseudoflavor); 65 u32 flavor = pseudoflavor_to_flavor(pseudoflavor);
66 66
67 if (flavor >= RPC_AUTH_MAXFLAVOR || !(ops = auth_flavors[flavor])) 67 auth = ERR_PTR(-EINVAL);
68 return ERR_PTR(-EINVAL); 68 if (flavor >= RPC_AUTH_MAXFLAVOR)
69 goto out;
70
71 /* FIXME - auth_flavors[] really needs an rw lock,
72 * and module refcounting. */
73#ifdef CONFIG_KMOD
74 if ((ops = auth_flavors[flavor]) == NULL)
75 request_module("rpc-auth-%u", flavor);
76#endif
77 if ((ops = auth_flavors[flavor]) == NULL)
78 goto out;
69 auth = ops->create(clnt, pseudoflavor); 79 auth = ops->create(clnt, pseudoflavor);
70 if (IS_ERR(auth)) 80 if (IS_ERR(auth))
71 return auth; 81 return auth;
72 if (clnt->cl_auth) 82 if (clnt->cl_auth)
73 rpcauth_destroy(clnt->cl_auth); 83 rpcauth_destroy(clnt->cl_auth);
74 clnt->cl_auth = auth; 84 clnt->cl_auth = auth;
85
86out:
75 return auth; 87 return auth;
76} 88}
77 89