Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294465
b: refs/heads/master
c: 6f51336
h: refs/heads/master
i:
  294463: 19990dd
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and Trond Myklebust committed Feb 15, 2012
1 parent 51fcdc8 commit cf45563
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 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: ef159e9177cc5a09e6174796dde0b2d243ddf28b
refs/heads/master: 6f5133652eaab6fbd88bdb1b1fd2236fd82583cb
19 changes: 13 additions & 6 deletions trunk/net/sunrpc/svc_xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,26 +932,33 @@ static void svc_close_list(struct list_head *xprt_list)
}
}

void svc_close_all(struct svc_serv *serv)
static void svc_clear_pools(struct svc_serv *serv)
{
struct svc_pool *pool;
struct svc_xprt *xprt;
struct svc_xprt *tmp;
int i;

svc_close_list(&serv->sv_tempsocks);
svc_close_list(&serv->sv_permsocks);

for (i = 0; i < serv->sv_nrpools; i++) {
pool = &serv->sv_pools[i];

spin_lock_bh(&pool->sp_lock);
while (!list_empty(&pool->sp_sockets)) {
xprt = list_first_entry(&pool->sp_sockets, struct svc_xprt, xpt_ready);
list_for_each_entry_safe(xprt, tmp, &pool->sp_sockets, xpt_ready) {
list_del_init(&xprt->xpt_ready);
}
spin_unlock_bh(&pool->sp_lock);
}
}

void svc_close_all(struct svc_serv *serv)
{
struct svc_xprt *xprt;
struct svc_xprt *tmp;

svc_close_list(&serv->sv_tempsocks);
svc_close_list(&serv->sv_permsocks);

svc_clear_pools(serv);
/*
* At this point the sp_sockets lists will stay empty, since
* svc_enqueue will not add new entries without taking the
Expand Down

0 comments on commit cf45563

Please sign in to comment.