提交 caf4ccd4 编写于 作者: T Trond Myklebust

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: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 0efeac26
...@@ -857,10 +857,7 @@ static void xs_close(struct rpc_xprt *xprt) ...@@ -857,10 +857,7 @@ static void xs_close(struct rpc_xprt *xprt)
static void xs_tcp_close(struct rpc_xprt *xprt) static void xs_tcp_close(struct rpc_xprt *xprt)
{ {
if (test_and_clear_bit(XPRT_CONNECTION_CLOSE, &xprt->state)) xs_tcp_shutdown(xprt);
xs_close(xprt);
else
xs_tcp_shutdown(xprt);
} }
static void xs_xprt_free(struct rpc_xprt *xprt) static void xs_xprt_free(struct rpc_xprt *xprt)
...@@ -1033,7 +1030,6 @@ static void xs_udp_data_ready(struct sock *sk) ...@@ -1033,7 +1030,6 @@ static void xs_udp_data_ready(struct sock *sk)
*/ */
static void xs_tcp_force_close(struct rpc_xprt *xprt) static void xs_tcp_force_close(struct rpc_xprt *xprt)
{ {
set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
xprt_force_disconnect(xprt); xprt_force_disconnect(xprt);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册