diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-11 17:21:25 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:05 -0400 |
commit | d19751e7b9bd8a01d00372325439589886674f79 (patch) | |
tree | 71ea849e8dc6021a455f2de1a76601e8db2255c7 /net/sunrpc/xprt.c | |
parent | dcfc4f25461813e8a2dd43b052aa1e0be155742f (diff) |
SUNRPC: Get rid of the redundant xprt->shutdown bit field
It is only set after everyone has dereferenced the transport,
and serves no useful purpose: setting it is racy, so all the
socket code, etc still needs to be able to cope with the cases
where they miss reading it.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 5d7f61d7559c..bd462a532acf 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -231,7 +231,7 @@ EXPORT_SYMBOL_GPL(xprt_reserve_xprt); | |||
231 | static void xprt_clear_locked(struct rpc_xprt *xprt) | 231 | static void xprt_clear_locked(struct rpc_xprt *xprt) |
232 | { | 232 | { |
233 | xprt->snd_task = NULL; | 233 | xprt->snd_task = NULL; |
234 | if (!test_bit(XPRT_CLOSE_WAIT, &xprt->state) || xprt->shutdown) { | 234 | if (!test_bit(XPRT_CLOSE_WAIT, &xprt->state)) { |
235 | smp_mb__before_clear_bit(); | 235 | smp_mb__before_clear_bit(); |
236 | clear_bit(XPRT_LOCKED, &xprt->state); | 236 | clear_bit(XPRT_LOCKED, &xprt->state); |
237 | smp_mb__after_clear_bit(); | 237 | smp_mb__after_clear_bit(); |
@@ -504,9 +504,6 @@ EXPORT_SYMBOL_GPL(xprt_wait_for_buffer_space); | |||
504 | */ | 504 | */ |
505 | void xprt_write_space(struct rpc_xprt *xprt) | 505 | void xprt_write_space(struct rpc_xprt *xprt) |
506 | { | 506 | { |
507 | if (unlikely(xprt->shutdown)) | ||
508 | return; | ||
509 | |||
510 | spin_lock_bh(&xprt->transport_lock); | 507 | spin_lock_bh(&xprt->transport_lock); |
511 | if (xprt->snd_task) { | 508 | if (xprt->snd_task) { |
512 | dprintk("RPC: write space: waking waiting task on " | 509 | dprintk("RPC: write space: waking waiting task on " |
@@ -679,7 +676,7 @@ xprt_init_autodisconnect(unsigned long data) | |||
679 | struct rpc_xprt *xprt = (struct rpc_xprt *)data; | 676 | struct rpc_xprt *xprt = (struct rpc_xprt *)data; |
680 | 677 | ||
681 | spin_lock(&xprt->transport_lock); | 678 | spin_lock(&xprt->transport_lock); |
682 | if (!list_empty(&xprt->recv) || xprt->shutdown) | 679 | if (!list_empty(&xprt->recv)) |
683 | goto out_abort; | 680 | goto out_abort; |
684 | if (test_and_set_bit(XPRT_LOCKED, &xprt->state)) | 681 | if (test_and_set_bit(XPRT_LOCKED, &xprt->state)) |
685 | goto out_abort; | 682 | goto out_abort; |
@@ -1262,7 +1259,6 @@ out: | |||
1262 | static void xprt_destroy(struct rpc_xprt *xprt) | 1259 | static void xprt_destroy(struct rpc_xprt *xprt) |
1263 | { | 1260 | { |
1264 | dprintk("RPC: destroying transport %p\n", xprt); | 1261 | dprintk("RPC: destroying transport %p\n", xprt); |
1265 | xprt->shutdown = 1; | ||
1266 | del_timer_sync(&xprt->timer); | 1262 | del_timer_sync(&xprt->timer); |
1267 | 1263 | ||
1268 | rpc_destroy_wait_queue(&xprt->binding); | 1264 | rpc_destroy_wait_queue(&xprt->binding); |