aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sunrpc/svc_xprt.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index de1e1a8b526b..50bf7c1c731c 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -932,26 +932,33 @@ static void svc_close_list(struct list_head *xprt_list)
932 } 932 }
933} 933}
934 934
935void svc_close_all(struct svc_serv *serv) 935static void svc_clear_pools(struct svc_serv *serv)
936{ 936{
937 struct svc_pool *pool; 937 struct svc_pool *pool;
938 struct svc_xprt *xprt; 938 struct svc_xprt *xprt;
939 struct svc_xprt *tmp; 939 struct svc_xprt *tmp;
940 int i; 940 int i;
941 941
942 svc_close_list(&serv->sv_tempsocks);
943 svc_close_list(&serv->sv_permsocks);
944
945 for (i = 0; i < serv->sv_nrpools; i++) { 942 for (i = 0; i < serv->sv_nrpools; i++) {
946 pool = &serv->sv_pools[i]; 943 pool = &serv->sv_pools[i];
947 944
948 spin_lock_bh(&pool->sp_lock); 945 spin_lock_bh(&pool->sp_lock);
949 while (!list_empty(&pool->sp_sockets)) { 946 list_for_each_entry_safe(xprt, tmp, &pool->sp_sockets, xpt_ready) {
950 xprt = list_first_entry(&pool->sp_sockets, struct svc_xprt, xpt_ready);
951 list_del_init(&xprt->xpt_ready); 947 list_del_init(&xprt->xpt_ready);
952 } 948 }
953 spin_unlock_bh(&pool->sp_lock); 949 spin_unlock_bh(&pool->sp_lock);
954 } 950 }
951}
952
953void svc_close_all(struct svc_serv *serv)
954{
955 struct svc_xprt *xprt;
956 struct svc_xprt *tmp;
957
958 svc_close_list(&serv->sv_tempsocks);
959 svc_close_list(&serv->sv_permsocks);
960
961 svc_clear_pools(serv);
955 /* 962 /*
956 * At this point the sp_sockets lists will stay empty, since 963 * At this point the sp_sockets lists will stay empty, since
957 * svc_enqueue will not add new entries without taking the 964 * svc_enqueue will not add new entries without taking the