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_generic.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_generic.c')
-rw-r--r-- | net/sunrpc/auth_generic.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index 8f623b0f03dd..8bae33b36cc6 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c | |||
@@ -27,7 +27,6 @@ struct generic_cred { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | static struct rpc_auth generic_auth; | 29 | static struct rpc_auth generic_auth; |
30 | static struct rpc_cred_cache generic_cred_cache; | ||
31 | static const struct rpc_credops generic_credops; | 30 | static const struct rpc_credops generic_credops; |
32 | 31 | ||
33 | /* | 32 | /* |
@@ -159,20 +158,16 @@ out_nomatch: | |||
159 | return 0; | 158 | return 0; |
160 | } | 159 | } |
161 | 160 | ||
162 | void __init rpc_init_generic_auth(void) | 161 | int __init rpc_init_generic_auth(void) |
163 | { | 162 | { |
164 | spin_lock_init(&generic_cred_cache.lock); | 163 | return rpcauth_init_credcache(&generic_auth); |
165 | } | 164 | } |
166 | 165 | ||
167 | void __exit rpc_destroy_generic_auth(void) | 166 | void __exit rpc_destroy_generic_auth(void) |
168 | { | 167 | { |
169 | rpcauth_clear_credcache(&generic_cred_cache); | 168 | rpcauth_destroy_credcache(&generic_auth); |
170 | } | 169 | } |
171 | 170 | ||
172 | static struct rpc_cred_cache generic_cred_cache = { | ||
173 | {{ NULL, },}, | ||
174 | }; | ||
175 | |||
176 | static const struct rpc_authops generic_auth_ops = { | 171 | static const struct rpc_authops generic_auth_ops = { |
177 | .owner = THIS_MODULE, | 172 | .owner = THIS_MODULE, |
178 | .au_name = "Generic", | 173 | .au_name = "Generic", |
@@ -183,7 +178,6 @@ static const struct rpc_authops generic_auth_ops = { | |||
183 | static struct rpc_auth generic_auth = { | 178 | static struct rpc_auth generic_auth = { |
184 | .au_ops = &generic_auth_ops, | 179 | .au_ops = &generic_auth_ops, |
185 | .au_count = ATOMIC_INIT(0), | 180 | .au_count = ATOMIC_INIT(0), |
186 | .au_credcache = &generic_cred_cache, | ||
187 | }; | 181 | }; |
188 | 182 | ||
189 | static const struct rpc_credops generic_credops = { | 183 | static const struct rpc_credops generic_credops = { |