aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth.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.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.c')
-rw-r--r--net/sunrpc/auth.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 73affb8624fa..db135543d21e 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -587,14 +587,27 @@ static struct shrinker rpc_cred_shrinker = {
587 .seeks = DEFAULT_SEEKS, 587 .seeks = DEFAULT_SEEKS,
588}; 588};
589 589
590void __init rpcauth_init_module(void) 590int __init rpcauth_init_module(void)
591{ 591{
592 rpc_init_authunix(); 592 int err;
593 rpc_init_generic_auth(); 593
594 err = rpc_init_authunix();
595 if (err < 0)
596 goto out1;
597 err = rpc_init_generic_auth();
598 if (err < 0)
599 goto out2;
594 register_shrinker(&rpc_cred_shrinker); 600 register_shrinker(&rpc_cred_shrinker);
601 return 0;
602out2:
603 rpc_destroy_authunix();
604out1:
605 return err;
595} 606}
596 607
597void __exit rpcauth_remove_module(void) 608void __exit rpcauth_remove_module(void)
598{ 609{
610 rpc_destroy_authunix();
611 rpc_destroy_generic_auth();
599 unregister_shrinker(&rpc_cred_shrinker); 612 unregister_shrinker(&rpc_cred_shrinker);
600} 613}