diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-07-31 14:29:07 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-08-04 08:52:57 -0400 |
commit | 5d8d9a4d9ff74c55901642b4e2ac5124830ddafe (patch) | |
tree | 9f171aa61048cf5c154597466af21ea7c4d701a2 /net/sunrpc/auth_unix.c | |
parent | d05dd4e98f0dd30ee933e05ac9363614c47df83a (diff) |
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.c | 15 |
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 { | |||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | static struct rpc_auth unix_auth; | 31 | static struct rpc_auth unix_auth; |
32 | static struct rpc_cred_cache unix_cred_cache; | ||
33 | static const struct rpc_credops unix_credops; | 32 | static const struct rpc_credops unix_credops; |
34 | 33 | ||
35 | static struct rpc_auth * | 34 | static struct rpc_auth * |
@@ -203,9 +202,14 @@ unx_validate(struct rpc_task *task, __be32 *p) | |||
203 | return p; | 202 | return p; |
204 | } | 203 | } |
205 | 204 | ||
206 | void __init rpc_init_authunix(void) | 205 | int __init rpc_init_authunix(void) |
207 | { | 206 | { |
208 | spin_lock_init(&unix_cred_cache.lock); | 207 | return rpcauth_init_credcache(&unix_auth); |
208 | } | ||
209 | |||
210 | void rpc_destroy_authunix(void) | ||
211 | { | ||
212 | rpcauth_destroy_credcache(&unix_auth); | ||
209 | } | 213 | } |
210 | 214 | ||
211 | const struct rpc_authops authunix_ops = { | 215 | const struct rpc_authops authunix_ops = { |
@@ -219,17 +223,12 @@ const struct rpc_authops authunix_ops = { | |||
219 | }; | 223 | }; |
220 | 224 | ||
221 | static | 225 | static |
222 | struct rpc_cred_cache unix_cred_cache = { | ||
223 | }; | ||
224 | |||
225 | static | ||
226 | struct rpc_auth unix_auth = { | 226 | struct rpc_auth unix_auth = { |
227 | .au_cslack = UNX_WRITESLACK, | 227 | .au_cslack = UNX_WRITESLACK, |
228 | .au_rslack = 2, /* assume AUTH_NULL verf */ | 228 | .au_rslack = 2, /* assume AUTH_NULL verf */ |
229 | .au_ops = &authunix_ops, | 229 | .au_ops = &authunix_ops, |
230 | .au_flavor = RPC_AUTH_UNIX, | 230 | .au_flavor = RPC_AUTH_UNIX, |
231 | .au_count = ATOMIC_INIT(0), | 231 | .au_count = ATOMIC_INIT(0), |
232 | .au_credcache = &unix_cred_cache, | ||
233 | }; | 232 | }; |
234 | 233 | ||
235 | static | 234 | static |