aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-01-13 05:03:04 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 19:28:14 -0500
commit5ecebb7c7fd737cf387a552994df319c063973db (patch)
tree5442ab61f417961b8908f1d2e82f837204830b80 /net/sunrpc
parentbee42f688c915b510a4aabae4f7a99457137d6f3 (diff)
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')
-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)
382 return 0; 382 return 0;
383} 383}
384 384
385void svc_rpcb_cleanup(struct svc_serv *serv) 385void svc_rpcb_cleanup(struct svc_serv *serv, struct net *net)
386{ 386{
387 svc_unregister(serv, &init_net); 387 svc_unregister(serv, net);
388 rpcb_put_local(&init_net); 388 rpcb_put_local(net);
389} 389}
390EXPORT_SYMBOL_GPL(svc_rpcb_cleanup); 390EXPORT_SYMBOL_GPL(svc_rpcb_cleanup);
391 391
@@ -411,7 +411,7 @@ static int svc_uses_rpcbind(struct svc_serv *serv)
411 */ 411 */
412static struct svc_serv * 412static struct svc_serv *
413__svc_create(struct svc_program *prog, unsigned int bufsize, int npools, 413__svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
414 void (*shutdown)(struct svc_serv *serv)) 414 void (*shutdown)(struct svc_serv *serv, struct net *net))
415{ 415{
416 struct svc_serv *serv; 416 struct svc_serv *serv;
417 unsigned int vers; 417 unsigned int vers;
@@ -485,7 +485,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
485 485
486struct svc_serv * 486struct svc_serv *
487svc_create(struct svc_program *prog, unsigned int bufsize, 487svc_create(struct svc_program *prog, unsigned int bufsize,
488 void (*shutdown)(struct svc_serv *serv)) 488 void (*shutdown)(struct svc_serv *serv, struct net *net))
489{ 489{
490 return __svc_create(prog, bufsize, /*npools*/1, shutdown); 490 return __svc_create(prog, bufsize, /*npools*/1, shutdown);
491} 491}
@@ -493,7 +493,7 @@ EXPORT_SYMBOL_GPL(svc_create);
493 493
494struct svc_serv * 494struct svc_serv *
495svc_create_pooled(struct svc_program *prog, unsigned int bufsize, 495svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
496 void (*shutdown)(struct svc_serv *serv), 496 void (*shutdown)(struct svc_serv *serv, struct net *net),
497 svc_thread_fn func, struct module *mod) 497 svc_thread_fn func, struct module *mod)
498{ 498{
499 struct svc_serv *serv; 499 struct svc_serv *serv;
@@ -542,7 +542,7 @@ svc_destroy(struct svc_serv *serv)
542 svc_close_all(serv); 542 svc_close_all(serv);
543 543
544 if (serv->sv_shutdown) 544 if (serv->sv_shutdown)
545 serv->sv_shutdown(serv); 545 serv->sv_shutdown(serv, current->nsproxy->net_ns);
546 546
547 cache_clean_deferred(serv); 547 cache_clean_deferred(serv);
548 548