summaryrefslogtreecommitdiff
path: root/net/sunrpc/auth_unix.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-07-31 14:29:07 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-08-04 08:52:57 -0400
commit5d8d9a4d9ff74c55901642b4e2ac5124830ddafe (patch)
tree9f171aa61048cf5c154597466af21ea7c4d701a2 /net/sunrpc/auth_unix.c
parentd05dd4e98f0dd30ee933e05ac9363614c47df83a (diff)
downloadlinux-stable-5d8d9a4d9ff74c55901642b4e2ac5124830ddafe.tar.gz
linux-stable-5d8d9a4d9ff74c55901642b4e2ac5124830ddafe.tar.bz2
linux-stable-5d8d9a4d9ff74c55901642b4e2ac5124830ddafe.zip
NFS: Ensure the AUTH_UNIX credcache is allocated dynamically
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_unix.c')
-rw-r--r--net/sunrpc/auth_unix.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index aac2f8b4ee21..d5e37dbf207b 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -29,7 +29,6 @@ struct unx_cred {
#endif
static struct rpc_auth unix_auth;
-static struct rpc_cred_cache unix_cred_cache;
static const struct rpc_credops unix_credops;
static struct rpc_auth *
@@ -203,9 +202,14 @@ unx_validate(struct rpc_task *task, __be32 *p)
return p;
}
-void __init rpc_init_authunix(void)
+int __init rpc_init_authunix(void)
{
- spin_lock_init(&unix_cred_cache.lock);
+ return rpcauth_init_credcache(&unix_auth);
+}
+
+void rpc_destroy_authunix(void)
+{
+ rpcauth_destroy_credcache(&unix_auth);
}
const struct rpc_authops authunix_ops = {
@@ -219,17 +223,12 @@ const struct rpc_authops authunix_ops = {
};
static
-struct rpc_cred_cache unix_cred_cache = {
-};
-
-static
struct rpc_auth unix_auth = {
.au_cslack = UNX_WRITESLACK,
.au_rslack = 2, /* assume AUTH_NULL verf */
.au_ops = &authunix_ops,
.au_flavor = RPC_AUTH_UNIX,
.au_count = ATOMIC_INIT(0),
- .au_credcache = &unix_cred_cache,
};
static