aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sunrpc_syms.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/sunrpc_syms.c')
-rw-r--r--net/sunrpc/sunrpc_syms.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index 8ec9778c3f4a..8adfc88e793a 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -25,10 +25,12 @@
25#include "netns.h" 25#include "netns.h"
26 26
27int sunrpc_net_id; 27int sunrpc_net_id;
28EXPORT_SYMBOL_GPL(sunrpc_net_id);
28 29
29static __net_init int sunrpc_init_net(struct net *net) 30static __net_init int sunrpc_init_net(struct net *net)
30{ 31{
31 int err; 32 int err;
33 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
32 34
33 err = rpc_proc_init(net); 35 err = rpc_proc_init(net);
34 if (err) 36 if (err)
@@ -38,8 +40,18 @@ static __net_init int sunrpc_init_net(struct net *net)
38 if (err) 40 if (err)
39 goto err_ipmap; 41 goto err_ipmap;
40 42
43 err = unix_gid_cache_create(net);
44 if (err)
45 goto err_unixgid;
46
47 rpc_pipefs_init_net(net);
48 INIT_LIST_HEAD(&sn->all_clients);
49 spin_lock_init(&sn->rpc_client_lock);
50 spin_lock_init(&sn->rpcb_clnt_lock);
41 return 0; 51 return 0;
42 52
53err_unixgid:
54 ip_map_cache_destroy(net);
43err_ipmap: 55err_ipmap:
44 rpc_proc_exit(net); 56 rpc_proc_exit(net);
45err_proc: 57err_proc:
@@ -48,6 +60,7 @@ err_proc:
48 60
49static __net_exit void sunrpc_exit_net(struct net *net) 61static __net_exit void sunrpc_exit_net(struct net *net)
50{ 62{
63 unix_gid_cache_destroy(net);
51 ip_map_cache_destroy(net); 64 ip_map_cache_destroy(net);
52 rpc_proc_exit(net); 65 rpc_proc_exit(net);
53} 66}
@@ -59,8 +72,6 @@ static struct pernet_operations sunrpc_net_ops = {
59 .size = sizeof(struct sunrpc_net), 72 .size = sizeof(struct sunrpc_net),
60}; 73};
61 74
62extern struct cache_detail unix_gid_cache;
63
64static int __init 75static int __init
65init_sunrpc(void) 76init_sunrpc(void)
66{ 77{
@@ -82,7 +93,6 @@ init_sunrpc(void)
82#ifdef RPC_DEBUG 93#ifdef RPC_DEBUG
83 rpc_register_sysctl(); 94 rpc_register_sysctl();
84#endif 95#endif
85 cache_register(&unix_gid_cache);
86 svc_init_xprt_sock(); /* svc sock transport */ 96 svc_init_xprt_sock(); /* svc sock transport */
87 init_socket_xprt(); /* clnt sock transport */ 97 init_socket_xprt(); /* clnt sock transport */
88 return 0; 98 return 0;
@@ -105,7 +115,6 @@ cleanup_sunrpc(void)
105 svc_cleanup_xprt_sock(); 115 svc_cleanup_xprt_sock();
106 unregister_rpc_pipefs(); 116 unregister_rpc_pipefs();
107 rpc_destroy_mempool(); 117 rpc_destroy_mempool();
108 cache_unregister(&unix_gid_cache);
109 unregister_pernet_subsys(&sunrpc_net_ops); 118 unregister_pernet_subsys(&sunrpc_net_ops);
110#ifdef RPC_DEBUG 119#ifdef RPC_DEBUG
111 rpc_unregister_sysctl(); 120 rpc_unregister_sysctl();