diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-10-25 18:11:21 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-11-19 18:35:11 -0500 |
commit | f8c0d226fef05226ff1a85055c8ed663022f40c1 (patch) | |
tree | 4c9a41dc3283b9e4b3f7ef891b7d4a874741abe6 /net | |
parent | ca7896cd83456082b1e78816cdf7e41658ef7bcd (diff) |
svcrpc: simplify svc_close_all
There's no need to be fooling with XPT_BUSY now that all the threads
are gone.
The list_del_init() here could execute at the same time as the
svc_xprt_enqueue()'s list_add_tail(), with undefined results. We don't
really care at this point, but it might result in a spurious
list-corruption warning or something.
And svc_close() isn't adding any value; just call svc_delete_xprt()
directly.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index dd61cd02461f..8c018df80692 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -941,16 +941,16 @@ void svc_close_all(struct list_head *xprt_list) | |||
941 | struct svc_xprt *xprt; | 941 | struct svc_xprt *xprt; |
942 | struct svc_xprt *tmp; | 942 | struct svc_xprt *tmp; |
943 | 943 | ||
944 | /* | ||
945 | * The server is shutting down, and no more threads are running. | ||
946 | * svc_xprt_enqueue() might still be running, but at worst it | ||
947 | * will re-add the xprt to sp_sockets, which will soon get | ||
948 | * freed. So we don't bother with any more locking, and don't | ||
949 | * leave the close to the (nonexistent) server threads: | ||
950 | */ | ||
944 | list_for_each_entry_safe(xprt, tmp, xprt_list, xpt_list) { | 951 | list_for_each_entry_safe(xprt, tmp, xprt_list, xpt_list) { |
945 | set_bit(XPT_CLOSE, &xprt->xpt_flags); | 952 | set_bit(XPT_CLOSE, &xprt->xpt_flags); |
946 | if (test_bit(XPT_BUSY, &xprt->xpt_flags)) { | 953 | svc_delete_xprt(xprt); |
947 | /* Waiting to be processed, but no threads left, | ||
948 | * So just remove it from the waiting list | ||
949 | */ | ||
950 | list_del_init(&xprt->xpt_ready); | ||
951 | clear_bit(XPT_BUSY, &xprt->xpt_flags); | ||
952 | } | ||
953 | svc_close_xprt(xprt); | ||
954 | } | 954 | } |
955 | } | 955 | } |
956 | 956 | ||