提交 3a22bf50 编写于 作者: S Stanislav Kinsbursky 提交者: Trond Myklebust

SUNRPC: clear svc transports lists helper introduced

This patch moves service transports deletion from service sockets lists to
separated function.
This is a precursor patch, which would be usefull with service shutdown in
network namespace context, introduced later in the series.
Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 6f513365
...@@ -950,11 +950,19 @@ static void svc_clear_pools(struct svc_serv *serv) ...@@ -950,11 +950,19 @@ static void svc_clear_pools(struct svc_serv *serv)
} }
} }
void svc_close_all(struct svc_serv *serv) static void svc_clear_list(struct list_head *xprt_list)
{ {
struct svc_xprt *xprt; struct svc_xprt *xprt;
struct svc_xprt *tmp; struct svc_xprt *tmp;
list_for_each_entry_safe(xprt, tmp, xprt_list, xpt_list) {
svc_delete_xprt(xprt);
}
BUG_ON(!list_empty(xprt_list));
}
void svc_close_all(struct svc_serv *serv)
{
svc_close_list(&serv->sv_tempsocks); svc_close_list(&serv->sv_tempsocks);
svc_close_list(&serv->sv_permsocks); svc_close_list(&serv->sv_permsocks);
...@@ -964,13 +972,8 @@ void svc_close_all(struct svc_serv *serv) ...@@ -964,13 +972,8 @@ void svc_close_all(struct svc_serv *serv)
* svc_enqueue will not add new entries without taking the * svc_enqueue will not add new entries without taking the
* sp_lock and checking XPT_BUSY. * sp_lock and checking XPT_BUSY.
*/ */
list_for_each_entry_safe(xprt, tmp, &serv->sv_tempsocks, xpt_list) svc_clear_list(&serv->sv_tempsocks);
svc_delete_xprt(xprt); svc_clear_list(&serv->sv_permsocks);
list_for_each_entry_safe(xprt, tmp, &serv->sv_permsocks, xpt_list)
svc_delete_xprt(xprt);
BUG_ON(!list_empty(&serv->sv_permsocks));
BUG_ON(!list_empty(&serv->sv_tempsocks));
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册