diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-31 05:09:08 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-02-15 00:19:45 -0500 |
commit | 3a22bf506c9df47e93e8dc8a68d86cd8ae384d98 (patch) | |
tree | 4dbbd631e3083969d265c8f2a0782c395882e09f /net | |
parent | 6f5133652eaab6fbd88bdb1b1fd2236fd82583cb (diff) |
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: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 50bf7c1c731c..493e70b72b71 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -950,11 +950,19 @@ static void svc_clear_pools(struct svc_serv *serv) | |||
950 | } | 950 | } |
951 | } | 951 | } |
952 | 952 | ||
953 | void svc_close_all(struct svc_serv *serv) | 953 | static void svc_clear_list(struct list_head *xprt_list) |
954 | { | 954 | { |
955 | struct svc_xprt *xprt; | 955 | struct svc_xprt *xprt; |
956 | struct svc_xprt *tmp; | 956 | struct svc_xprt *tmp; |
957 | 957 | ||
958 | list_for_each_entry_safe(xprt, tmp, xprt_list, xpt_list) { | ||
959 | svc_delete_xprt(xprt); | ||
960 | } | ||
961 | BUG_ON(!list_empty(xprt_list)); | ||
962 | } | ||
963 | |||
964 | void svc_close_all(struct svc_serv *serv) | ||
965 | { | ||
958 | svc_close_list(&serv->sv_tempsocks); | 966 | svc_close_list(&serv->sv_tempsocks); |
959 | svc_close_list(&serv->sv_permsocks); | 967 | svc_close_list(&serv->sv_permsocks); |
960 | 968 | ||
@@ -964,13 +972,8 @@ void svc_close_all(struct svc_serv *serv) | |||
964 | * svc_enqueue will not add new entries without taking the | 972 | * svc_enqueue will not add new entries without taking the |
965 | * sp_lock and checking XPT_BUSY. | 973 | * sp_lock and checking XPT_BUSY. |
966 | */ | 974 | */ |
967 | list_for_each_entry_safe(xprt, tmp, &serv->sv_tempsocks, xpt_list) | 975 | svc_clear_list(&serv->sv_tempsocks); |
968 | svc_delete_xprt(xprt); | 976 | svc_clear_list(&serv->sv_permsocks); |
969 | list_for_each_entry_safe(xprt, tmp, &serv->sv_permsocks, xpt_list) | ||
970 | svc_delete_xprt(xprt); | ||
971 | |||
972 | BUG_ON(!list_empty(&serv->sv_permsocks)); | ||
973 | BUG_ON(!list_empty(&serv->sv_tempsocks)); | ||
974 | } | 977 | } |
975 | 978 | ||
976 | /* | 979 | /* |