summaryrefslogtreecommitdiff
path: root/net/sunrpc/sunrpc_syms.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2010-09-27 14:02:29 +0400
committerJ. Bruce Fields <bfields@redhat.com>2010-09-27 18:16:12 +0400
commit90d51b02fd702d969eb05bd9d4ecc954759fbe23 (patch)
treefb5409d3ed5844be89a284097a930e1ff5ea37de /net/sunrpc/sunrpc_syms.c
parent4f42d0d53ca4737f82937edb0efc83564c124853 (diff)
downloadlinux-90d51b02fd702d969eb05bd9d4ecc954759fbe23.tar.xz
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)
if (err)
goto err_proc;
+ err = ip_map_cache_create(net);
+ if (err)
+ goto err_ipmap;
+
return 0;
+err_ipmap:
+ rpc_proc_exit(net);
err_proc:
return err;
}
static __net_exit void sunrpc_exit_net(struct net *net)
{
+ ip_map_cache_destroy(net);
rpc_proc_exit(net);
}
@@ -52,7 +59,7 @@ static struct pernet_operations sunrpc_net_ops = {
.size = sizeof(struct sunrpc_net),
};
-extern struct cache_detail ip_map_cache, unix_gid_cache;
+extern struct cache_detail unix_gid_cache;
extern void cleanup_rpcb_clnt(void);
@@ -77,7 +84,6 @@ init_sunrpc(void)
#ifdef RPC_DEBUG
rpc_register_sysctl();
#endif
- cache_register(&ip_map_cache);
cache_register(&unix_gid_cache);
svc_init_xprt_sock(); /* svc sock transport */
init_socket_xprt(); /* clnt sock transport */
@@ -102,7 +108,6 @@ cleanup_sunrpc(void)
svc_cleanup_xprt_sock();
unregister_rpc_pipefs();
rpc_destroy_mempool();
- cache_unregister(&ip_map_cache);
cache_unregister(&unix_gid_cache);
unregister_pernet_subsys(&sunrpc_net_ops);
#ifdef RPC_DEBUG