diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-11-29 11:35:35 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-12-06 16:18:52 -0500 |
commit | 2fefb8a09e7ed251ae8996e0c69066e74c5aa560 (patch) | |
tree | 6d353a2051063f63f4667d9e2d54ec30dec91049 /net | |
parent | 7710ec36b6f516e026f9e29e50e67d2547c2a79b (diff) |
svcrpc: destroy server sockets all at once
There's no reason I can see that we need to call sv_shutdown between
closing the two lists of sockets.
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc.c | 7 | ||||
-rw-r--r-- | net/sunrpc/svc_xprt.c | 11 |
2 files changed, 11 insertions, 7 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 6e038884ae0c..60babf0a9847 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -528,16 +528,11 @@ svc_destroy(struct svc_serv *serv) | |||
528 | 528 | ||
529 | del_timer_sync(&serv->sv_temptimer); | 529 | del_timer_sync(&serv->sv_temptimer); |
530 | 530 | ||
531 | svc_close_all(&serv->sv_tempsocks); | 531 | svc_close_all(serv); |
532 | 532 | ||
533 | if (serv->sv_shutdown) | 533 | if (serv->sv_shutdown) |
534 | serv->sv_shutdown(serv); | 534 | serv->sv_shutdown(serv); |
535 | 535 | ||
536 | svc_close_all(&serv->sv_permsocks); | ||
537 | |||
538 | BUG_ON(!list_empty(&serv->sv_permsocks)); | ||
539 | BUG_ON(!list_empty(&serv->sv_tempsocks)); | ||
540 | |||
541 | cache_clean_deferred(serv); | 536 | cache_clean_deferred(serv); |
542 | 537 | ||
543 | if (svc_serv_is_pooled(serv)) | 538 | if (svc_serv_is_pooled(serv)) |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 8046c6d1f9c2..099ddf99d2a1 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -929,7 +929,7 @@ void svc_close_xprt(struct svc_xprt *xprt) | |||
929 | } | 929 | } |
930 | EXPORT_SYMBOL_GPL(svc_close_xprt); | 930 | EXPORT_SYMBOL_GPL(svc_close_xprt); |
931 | 931 | ||
932 | void svc_close_all(struct list_head *xprt_list) | 932 | static void svc_close_list(struct list_head *xprt_list) |
933 | { | 933 | { |
934 | struct svc_xprt *xprt; | 934 | struct svc_xprt *xprt; |
935 | struct svc_xprt *tmp; | 935 | struct svc_xprt *tmp; |
@@ -947,6 +947,15 @@ void svc_close_all(struct list_head *xprt_list) | |||
947 | } | 947 | } |
948 | } | 948 | } |
949 | 949 | ||
950 | void svc_close_all(struct svc_serv *serv) | ||
951 | { | ||
952 | svc_close_list(&serv->sv_tempsocks); | ||
953 | svc_close_list(&serv->sv_permsocks); | ||
954 | BUG_ON(!list_empty(&serv->sv_permsocks)); | ||
955 | BUG_ON(!list_empty(&serv->sv_tempsocks)); | ||
956 | |||
957 | } | ||
958 | |||
950 | /* | 959 | /* |
951 | * Handle defer and revisit of requests | 960 | * Handle defer and revisit of requests |
952 | */ | 961 | */ |