All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 08/11] SUNRPC: Kill the special TCP close mechanisms
Date: Sun,  8 Feb 2015 22:07:39 -0500	[thread overview]
Message-ID: <1423451262-84493-9-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1423451262-84493-8-git-send-email-trond.myklebust@primarydata.com>

Just use the ordinary sock_release() now that we can reuse ports.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 net/sunrpc/xprtsock.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index dbf279cd4494..b5dfb4f14ef9 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -623,24 +623,6 @@ process_status:
 }
 
 /**
- * xs_tcp_shutdown - gracefully shut down a TCP socket
- * @xprt: transport
- *
- * Initiates a graceful shutdown of the TCP socket by calling the
- * equivalent of shutdown(SHUT_WR);
- */
-static void xs_tcp_shutdown(struct rpc_xprt *xprt)
-{
-	struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
-	struct socket *sock = transport->sock;
-
-	if (sock != NULL) {
-		kernel_sock_shutdown(sock, SHUT_WR);
-		trace_rpc_socket_shutdown(xprt, sock);
-	}
-}
-
-/**
  * xs_tcp_send_request - write an RPC request to a TCP socket
  * @task: address of RPC task that manages the state of an RPC request
  *
@@ -718,7 +700,6 @@ static int xs_tcp_send_request(struct rpc_task *task)
 		dprintk("RPC:       sendmsg returned unrecognized error %d\n",
 			-status);
 	case -ECONNRESET:
-		xs_tcp_shutdown(xprt);
 	case -ECONNREFUSED:
 	case -ENOTCONN:
 	case -EADDRINUSE:
@@ -856,14 +837,6 @@ static void xs_close(struct rpc_xprt *xprt)
 	xprt_disconnect_done(xprt);
 }
 
-static void xs_tcp_close(struct rpc_xprt *xprt)
-{
-	if (test_and_clear_bit(XPRT_CONNECTION_CLOSE, &xprt->state))
-		xs_close(xprt);
-	else
-		xs_tcp_shutdown(xprt);
-}
-
 static void xs_xprt_free(struct rpc_xprt *xprt)
 {
 	xs_free_peer_addresses(xprt);
@@ -1034,7 +1007,6 @@ static void xs_udp_data_ready(struct sock *sk)
  */
 static void xs_tcp_force_close(struct rpc_xprt *xprt)
 {
-	set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
 	xprt_force_disconnect(xprt);
 }
 
@@ -2540,7 +2512,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
 	.buf_free		= rpc_free,
 	.send_request		= xs_tcp_send_request,
 	.set_retrans_timeout	= xprt_set_retrans_timeout_def,
-	.close			= xs_tcp_close,
+	.close			= xs_close,
 	.destroy		= xs_destroy,
 	.print_stats		= xs_tcp_print_stats,
 };
-- 
2.1.0


  reply	other threads:[~2015-02-09  3:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09  3:07 [PATCH 00/11] Fix TCP connection port number reuse in NFSv3 Trond Myklebust
2015-02-09  3:07 ` [PATCH 01/11] SUNRPC: Set SO_REUSEPORT socket option for TCP connections Trond Myklebust
2015-02-09  3:07   ` [PATCH 02/11] SUNRPC: Handle EADDRINUSE on connect Trond Myklebust
2015-02-09  3:07     ` [PATCH 03/11] SUNRPC: Do not clear the source port in xs_reset_transport Trond Myklebust
2015-02-09  3:07       ` [PATCH 04/11] SUNRPC: Ensure xs_reset_transport() resets the close connection flags Trond Myklebust
2015-02-09  3:07         ` [PATCH 05/11] SUNRPC: Add helpers to prevent socket create from racing Trond Myklebust
2015-02-09  3:07           ` [PATCH 06/11] SUNRPC: TCP/UDP always close the old socket before reconnecting Trond Myklebust
2015-02-09  3:07             ` [PATCH 07/11] SUNRPC: Remove TCP client connection reset hack Trond Myklebust
2015-02-09  3:07               ` Trond Myklebust [this message]
2015-02-09  3:07                 ` [PATCH 09/11] SUNRPC: Remove TCP socket linger code Trond Myklebust
2015-02-09  3:07                   ` [PATCH 10/11] SUNRPC: Cleanup to remove remaining uses of XPRT_CONNECTION_ABORT Trond Myklebust
2015-02-09  3:07                     ` [PATCH 11/11] SUNRPC: Remove the redundant XPRT_CONNECTION_CLOSE flag Trond Myklebust
2015-02-09 15:31                   ` [PATCH 09/11] SUNRPC: Remove TCP socket linger code Anna Schumaker
2015-02-09 15:37                     ` Trond Myklebust
2015-02-09 15:39                       ` Anna Schumaker
2015-02-09 15:59                         ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423451262-84493-9-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.