NFS: Ensure the AUTH_UNIX credcache is allocated dynamically

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Trond Myklebust
2010-07-31 14:29:07 -04:00
parent d05dd4e98f
commit 5d8d9a4d9f
5 changed files with 40 additions and 28 deletions

View File

@ -27,7 +27,6 @@ struct generic_cred {
};
static struct rpc_auth generic_auth;
static struct rpc_cred_cache generic_cred_cache;
static const struct rpc_credops generic_credops;
/*
@ -159,20 +158,16 @@ out_nomatch:
return 0;
}
void __init rpc_init_generic_auth(void)
int __init rpc_init_generic_auth(void)
{
spin_lock_init(&generic_cred_cache.lock);
return rpcauth_init_credcache(&generic_auth);
}
void __exit rpc_destroy_generic_auth(void)
{
rpcauth_clear_credcache(&generic_cred_cache);
rpcauth_destroy_credcache(&generic_auth);
}
static struct rpc_cred_cache generic_cred_cache = {
{{ NULL, },},
};
static const struct rpc_authops generic_auth_ops = {
.owner = THIS_MODULE,
.au_name = "Generic",
@ -183,7 +178,6 @@ static const struct rpc_authops generic_auth_ops = {
static struct rpc_auth generic_auth = {
.au_ops = &generic_auth_ops,
.au_count = ATOMIC_INIT(0),
.au_credcache = &generic_cred_cache,
};
static const struct rpc_credops generic_credops = {