Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294468
b: refs/heads/master
c: 074d0f6
h: refs/heads/master
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and Trond Myklebust committed Feb 15, 2012
1 parent 892bc79 commit 6b7c2c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b147f1ff267d12e0d189ca3d4156ed5a76b8d99
refs/heads/master: 074d0f67cfe0af4927ce49560f403096b490c47f
33 changes: 20 additions & 13 deletions trunk/net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,24 @@ svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
}
EXPORT_SYMBOL_GPL(svc_create_pooled);

void svc_shutdown_net(struct svc_serv *serv, struct net *net)
{
/*
* The set of xprts (contained in the sv_tempsocks and
* sv_permsocks lists) is now constant, since it is modified
* only by accepting new sockets (done by service threads in
* svc_recv) or aging old ones (done by sv_temptimer), or
* configuration changes (excluded by whatever locking the
* caller is using--nfsd_mutex in the case of nfsd). So it's
* safe to traverse those lists and shut everything down:
*/
svc_close_net(serv, net);

if (serv->sv_shutdown)
serv->sv_shutdown(serv, net);
}
EXPORT_SYMBOL_GPL(svc_shutdown_net);

/*
* Destroy an RPC service. Should be called with appropriate locking to
* protect the sv_nrthreads, sv_permsocks and sv_tempsocks.
Expand All @@ -532,16 +550,8 @@ svc_destroy(struct svc_serv *serv)
printk("svc_destroy: no threads for serv=%p!\n", serv);

del_timer_sync(&serv->sv_temptimer);
/*
* The set of xprts (contained in the sv_tempsocks and
* sv_permsocks lists) is now constant, since it is modified
* only by accepting new sockets (done by service threads in
* svc_recv) or aging old ones (done by sv_temptimer), or
* configuration changes (excluded by whatever locking the
* caller is using--nfsd_mutex in the case of nfsd). So it's
* safe to traverse those lists and shut everything down:
*/
svc_close_net(serv, net);

svc_shutdown_net(serv, net);

/*
* The last user is gone and thus all sockets have to be destroyed to
Expand All @@ -550,9 +560,6 @@ svc_destroy(struct svc_serv *serv)
BUG_ON(!list_empty(&serv->sv_permsocks));
BUG_ON(!list_empty(&serv->sv_tempsocks));

if (serv->sv_shutdown)
serv->sv_shutdown(serv, net);

cache_clean_deferred(serv);

if (svc_serv_is_pooled(serv))
Expand Down

0 comments on commit 6b7c2c1

Please sign in to comment.