aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-09 09:23:34 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-02-09 11:20:44 -0500
commitcaf4ccd4e88cf2795c927834bc488c8321437586 (patch)
tree34551130a009cc920f907bca6a804f0d380f7814 /net/sunrpc/xprtsock.c
parent0efeac261c3f79c44fe61ee869722b77805c7ddf (diff)
SUNRPC: Make xs_tcp_close() do a socket shutdown rather than a sock_release
Use of socket shutdown() means that we monitor the shutdown process through the xs_tcp_state_change() callback, so it is preferable to a full close in all cases unless we're destroying the transport. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 3d83cbd32ef2..0279e8ffb14a 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -857,10 +857,7 @@ static void xs_close(struct rpc_xprt *xprt)
857 857
858static void xs_tcp_close(struct rpc_xprt *xprt) 858static void xs_tcp_close(struct rpc_xprt *xprt)
859{ 859{
860 if (test_and_clear_bit(XPRT_CONNECTION_CLOSE, &xprt->state)) 860 xs_tcp_shutdown(xprt);
861 xs_close(xprt);
862 else
863 xs_tcp_shutdown(xprt);
864} 861}
865 862
866static void xs_xprt_free(struct rpc_xprt *xprt) 863static void xs_xprt_free(struct rpc_xprt *xprt)
@@ -1033,7 +1030,6 @@ static void xs_udp_data_ready(struct sock *sk)
1033 */ 1030 */
1034static void xs_tcp_force_close(struct rpc_xprt *xprt) 1031static void xs_tcp_force_close(struct rpc_xprt *xprt)
1035{ 1032{
1036 set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
1037 xprt_force_disconnect(xprt); 1033 xprt_force_disconnect(xprt);
1038} 1034}
1039 1035