aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sunrpc_syms.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2010-09-27 06:02:29 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-09-27 10:16:12 -0400
commit90d51b02fd702d969eb05bd9d4ecc954759fbe23 (patch)
treefb5409d3ed5844be89a284097a930e1ff5ea37de /net/sunrpc/sunrpc_syms.c
parent4f42d0d53ca4737f82937edb0efc83564c124853 (diff)
sunrpc: Make the ip_map_cache be per-net
Everything that is required for that already exists: * the per-net cache registration with respective proc entries * the context (struct net) is available in all the users Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/sunrpc_syms.c')
-rw-r--r--net/sunrpc/sunrpc_syms.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index c076af8535db..9d0809160994 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -34,14 +34,21 @@ static __net_init int sunrpc_init_net(struct net *net)
34 if (err) 34 if (err)
35 goto err_proc; 35 goto err_proc;
36 36
37 err = ip_map_cache_create(net);
38 if (err)
39 goto err_ipmap;
40
37 return 0; 41 return 0;
38 42
43err_ipmap:
44 rpc_proc_exit(net);
39err_proc: 45err_proc:
40 return err; 46 return err;
41} 47}
42 48
43static __net_exit void sunrpc_exit_net(struct net *net) 49static __net_exit void sunrpc_exit_net(struct net *net)
44{ 50{
51 ip_map_cache_destroy(net);
45 rpc_proc_exit(net); 52 rpc_proc_exit(net);
46} 53}
47 54
@@ -52,7 +59,7 @@ static struct pernet_operations sunrpc_net_ops = {
52 .size = sizeof(struct sunrpc_net), 59 .size = sizeof(struct sunrpc_net),
53}; 60};
54 61
55extern struct cache_detail ip_map_cache, unix_gid_cache; 62extern struct cache_detail unix_gid_cache;
56 63
57extern void cleanup_rpcb_clnt(void); 64extern void cleanup_rpcb_clnt(void);
58 65
@@ -77,7 +84,6 @@ init_sunrpc(void)
77#ifdef RPC_DEBUG 84#ifdef RPC_DEBUG
78 rpc_register_sysctl(); 85 rpc_register_sysctl();
79#endif 86#endif
80 cache_register(&ip_map_cache);
81 cache_register(&unix_gid_cache); 87 cache_register(&unix_gid_cache);
82 svc_init_xprt_sock(); /* svc sock transport */ 88 svc_init_xprt_sock(); /* svc sock transport */
83 init_socket_xprt(); /* clnt sock transport */ 89 init_socket_xprt(); /* clnt sock transport */
@@ -102,7 +108,6 @@ cleanup_sunrpc(void)
102 svc_cleanup_xprt_sock(); 108 svc_cleanup_xprt_sock();
103 unregister_rpc_pipefs(); 109 unregister_rpc_pipefs();
104 rpc_destroy_mempool(); 110 rpc_destroy_mempool();
105 cache_unregister(&ip_map_cache);
106 cache_unregister(&unix_gid_cache); 111 cache_unregister(&unix_gid_cache);
107 unregister_pernet_subsys(&sunrpc_net_ops); 112 unregister_pernet_subsys(&sunrpc_net_ops);
108#ifdef RPC_DEBUG 113#ifdef RPC_DEBUG