aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_generic.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_generic.c
parentd05dd4e98f0dd30ee933e05ac9363614c47df83a (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.c12
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
29static struct rpc_auth generic_auth; 29static struct rpc_auth generic_auth;
30static struct rpc_cred_cache generic_cred_cache;
31static const struct rpc_credops generic_credops; 30static 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
162void __init rpc_init_generic_auth(void) 161int __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
167void __exit rpc_destroy_generic_auth(void) 166void __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
172static struct rpc_cred_cache generic_cred_cache = {
173 {{ NULL, },},
174};
175
176static const struct rpc_authops generic_auth_ops = { 171static 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 = {
183static struct rpc_auth generic_auth = { 178static 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
189static const struct rpc_credops generic_credops = { 183static const struct rpc_credops generic_credops = {