summaryrefslogtreecommitdiff
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-01-13 14:03:04 +0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 19:28:14 -0500
commit5ecebb7c7fd737cf387a552994df319c063973db (patch)
tree5442ab61f417961b8908f1d2e82f837204830b80 /net/sunrpc/svc.c
parentbee42f688c915b510a4aabae4f7a99457137d6f3 (diff)
downloadlinux-exynos-5ecebb7c7fd737cf387a552994df319c063973db.tar.gz
linux-exynos-5ecebb7c7fd737cf387a552994df319c063973db.tar.bz2
linux-exynos-5ecebb7c7fd737cf387a552994df319c063973db.zip
SUNRPC: unregister service on creation in current network namespace
On service shutdown we can be sure, that no more users of it left except current. Thus it looks like using current network namespace context is safe in this case. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index cb2caaee2af9..a8b49a044619 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -382,10 +382,10 @@ static int svc_rpcb_setup(struct svc_serv *serv, struct net *net)
return 0;
}
-void svc_rpcb_cleanup(struct svc_serv *serv)
+void svc_rpcb_cleanup(struct svc_serv *serv, struct net *net)
{
- svc_unregister(serv, &init_net);
- rpcb_put_local(&init_net);
+ svc_unregister(serv, net);
+ rpcb_put_local(net);
}
EXPORT_SYMBOL_GPL(svc_rpcb_cleanup);
@@ -411,7 +411,7 @@ static int svc_uses_rpcbind(struct svc_serv *serv)
*/
static struct svc_serv *
__svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
- void (*shutdown)(struct svc_serv *serv))
+ void (*shutdown)(struct svc_serv *serv, struct net *net))
{
struct svc_serv *serv;
unsigned int vers;
@@ -485,7 +485,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
struct svc_serv *
svc_create(struct svc_program *prog, unsigned int bufsize,
- void (*shutdown)(struct svc_serv *serv))
+ void (*shutdown)(struct svc_serv *serv, struct net *net))
{
return __svc_create(prog, bufsize, /*npools*/1, shutdown);
}
@@ -493,7 +493,7 @@ EXPORT_SYMBOL_GPL(svc_create);
struct svc_serv *
svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
- void (*shutdown)(struct svc_serv *serv),
+ void (*shutdown)(struct svc_serv *serv, struct net *net),
svc_thread_fn func, struct module *mod)
{
struct svc_serv *serv;
@@ -542,7 +542,7 @@ svc_destroy(struct svc_serv *serv)
svc_close_all(serv);
if (serv->sv_shutdown)
- serv->sv_shutdown(serv);
+ serv->sv_shutdown(serv, current->nsproxy->net_ns);
cache_clean_deferred(serv);