diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-31 05:09:17 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-02-15 00:19:45 -0500 |
commit | 7b147f1ff267d12e0d189ca3d4156ed5a76b8d99 (patch) | |
tree | 651496e6e08521de934b2ad0953e2b81d3f5da2f /net/sunrpc/svc.c | |
parent | 3a22bf506c9df47e93e8dc8a68d86cd8ae384d98 (diff) |
SUNRPC: service destruction in network namespace context
v2: Added comment to BUG_ON's in svc_destroy() to make code looks clearer.
This patch introduces network namespace filter for service destruction
function.
Nothing special here - just do exactly the same operations, but only for
tranports in passed networks namespace context.
BTW, BUG_ON() checks for empty service transports lists were returned into
svc_destroy() function. This is because of swithing generic svc_close_all() to
networks namespace dependable svc_close_net().
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.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index a8b49a044619..6cc0ea3d26f1 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -517,6 +517,8 @@ EXPORT_SYMBOL_GPL(svc_create_pooled); | |||
517 | void | 517 | void |
518 | svc_destroy(struct svc_serv *serv) | 518 | svc_destroy(struct svc_serv *serv) |
519 | { | 519 | { |
520 | struct net *net = current->nsproxy->net_ns; | ||
521 | |||
520 | dprintk("svc: svc_destroy(%s, %d)\n", | 522 | dprintk("svc: svc_destroy(%s, %d)\n", |
521 | serv->sv_program->pg_name, | 523 | serv->sv_program->pg_name, |
522 | serv->sv_nrthreads); | 524 | serv->sv_nrthreads); |
@@ -539,10 +541,17 @@ svc_destroy(struct svc_serv *serv) | |||
539 | * caller is using--nfsd_mutex in the case of nfsd). So it's | 541 | * caller is using--nfsd_mutex in the case of nfsd). So it's |
540 | * safe to traverse those lists and shut everything down: | 542 | * safe to traverse those lists and shut everything down: |
541 | */ | 543 | */ |
542 | svc_close_all(serv); | 544 | svc_close_net(serv, net); |
545 | |||
546 | /* | ||
547 | * The last user is gone and thus all sockets have to be destroyed to | ||
548 | * the point. Check this. | ||
549 | */ | ||
550 | BUG_ON(!list_empty(&serv->sv_permsocks)); | ||
551 | BUG_ON(!list_empty(&serv->sv_tempsocks)); | ||
543 | 552 | ||
544 | if (serv->sv_shutdown) | 553 | if (serv->sv_shutdown) |
545 | serv->sv_shutdown(serv, current->nsproxy->net_ns); | 554 | serv->sv_shutdown(serv, net); |
546 | 555 | ||
547 | cache_clean_deferred(serv); | 556 | cache_clean_deferred(serv); |
548 | 557 | ||