All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@parallels.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: [PATCH 4/13] sunrpc: Remove duplicate xprt/transport arguments from calls
Date: Mon, 04 Oct 2010 16:52:55 +0400	[thread overview]
Message-ID: <4CA9CE27.3010000@parallels.com> (raw)
In-Reply-To: <4CA9CDA8.4010407@parallels.com>

The xs_tcp_reuse_connection takes the xprt only to pass it down
to the xs_abort_connection. The later one can get it from the given
transport itself.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
 net/sunrpc/xprtsock.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index a76446a..8ff57c5 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1754,12 +1754,12 @@ out:
  * We need to preserve the port number so the reply cache on the server can
  * find our cached RPC replies when we get around to reconnecting.
  */
-static void xs_abort_connection(struct rpc_xprt *xprt, struct sock_xprt *transport)
+static void xs_abort_connection(struct sock_xprt *transport)
 {
 	int result;
 	struct sockaddr any;
 
-	dprintk("RPC:       disconnecting xprt %p to reuse port\n", xprt);
+	dprintk("RPC:       disconnecting xprt %p to reuse port\n", transport);
 
 	/*
 	 * Disconnect the transport socket by doing a connect operation
@@ -1769,13 +1769,13 @@ static void xs_abort_connection(struct rpc_xprt *xprt, struct sock_xprt *transpo
 	any.sa_family = AF_UNSPEC;
 	result = kernel_connect(transport->sock, &any, sizeof(any), 0);
 	if (!result)
-		xs_sock_mark_closed(xprt);
+		xs_sock_mark_closed(&transport->xprt);
 	else
 		dprintk("RPC:       AF_UNSPEC connect return code %d\n",
 				result);
 }
 
-static void xs_tcp_reuse_connection(struct rpc_xprt *xprt, struct sock_xprt *transport)
+static void xs_tcp_reuse_connection(struct sock_xprt *transport)
 {
 	unsigned int state = transport->inet->sk_state;
 
@@ -1798,7 +1798,7 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt, struct sock_xprt *tra
 				"sk_shutdown set to %d\n",
 				__func__, transport->inet->sk_shutdown);
 	}
-	xs_abort_connection(xprt, transport);
+	xs_abort_connection(transport);
 }
 
 static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
@@ -1875,7 +1875,7 @@ static void xs_tcp_setup_socket(struct sock_xprt *transport,
 		abort_and_exit = test_and_clear_bit(XPRT_CONNECTION_ABORT,
 				&xprt->state);
 		/* "close" the socket, preserving the local port */
-		xs_tcp_reuse_connection(xprt, transport);
+		xs_tcp_reuse_connection(transport);
 
 		if (abort_and_exit)
 			goto out_eagain;
-- 
1.5.5.6


  parent reply	other threads:[~2010-10-04 12:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 12:50 [PATCH 0/13] sunrpc: Compact the xprtsock code a bit Pavel Emelyanov
2010-10-04 12:51 ` [PATCH 1/13] sunrpc: Remove unused sock arg from xs_get_srcport Pavel Emelyanov
2010-10-04 12:51 ` [PATCH 2/13] sunrpc: Remove unused sock arg from xs_next_srcport Pavel Emelyanov
2010-10-04 12:52 ` [PATCH 3/13] sunrpc: Get xprt pointer once in xs_tcp_setup_socket Pavel Emelyanov
2010-10-04 12:52 ` Pavel Emelyanov [this message]
2010-10-04 12:53 ` [PATCH 5/13] sunrpc: Factor out udp sockets creation Pavel Emelyanov
2010-10-04 12:54 ` [PATCH 6/13] sunrpc: Factor out v4 " Pavel Emelyanov
2010-10-04 12:54 ` [PATCH 7/13] sunrpc: Factor out v6 " Pavel Emelyanov
2010-10-04 12:55 ` [PATCH 8/13] sunrpc: Call xs_create_sockX directly from setup_socket Pavel Emelyanov
2010-10-04 12:56 ` [PATCH 9/13] sunrpc: Merge the xs_bind code Pavel Emelyanov
2010-10-05  3:20   ` Chuck Lever
2010-10-05  5:42     ` Pavel Emelyanov
2010-10-05 11:53       ` [PATCH v2 " Pavel Emelyanov
2010-10-06  3:04         ` Chuck Lever
2010-10-15 16:05         ` J. Bruce Fields
2010-10-15 16:24           ` Pavel Emelyanov
2010-10-15 16:39           ` Chuck Lever
2010-10-15 18:08             ` J. Bruce Fields
2010-10-15 18:09               ` J. Bruce Fields
2010-10-15 18:11               ` Chuck Lever
2010-10-18 21:15                 ` J. Bruce Fields
2010-10-18 21:43                   ` J. Bruce Fields
2010-10-18 21:53                     ` Chuck Lever
2010-10-18 21:57                       ` J. Bruce Fields
2010-10-18 22:37                         ` Chuck Lever
2010-10-18 23:55                           ` J. Bruce Fields
2010-10-19 14:35                             ` Chuck Lever
2010-10-19 15:20                               ` J. Bruce Fields
2010-10-20  9:19                                 ` Pavel Emelyanov
2010-10-04 12:56 ` [PATCH 10/13] sunrpc: Merge xs_create_sock code Pavel Emelyanov
2010-10-04 12:57 ` [PATCH 11/13] sunrpc: Pass family to setup_socket calls Pavel Emelyanov
2010-10-04 12:57 ` [PATCH 12/13] sunrpc: Remove TCP worker wrappers Pavel Emelyanov
2010-10-04 12:58 ` [PATCH 13/13] sunrpc: Remove UDP " Pavel Emelyanov
2010-10-11 23:47 ` [PATCH 0/13] sunrpc: Compact the xprtsock code a bit J. Bruce Fields
2010-10-12  7:51   ` Pavel Emelyanov
2010-10-12 13:50     ` J. Bruce Fields
2010-10-12 15:21       ` Pavel Emelyanov
2010-10-15 15:03         ` J. Bruce Fields

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=4CA9CE27.3010000@parallels.com \
    --to=xemul@parallels.com \
    --cc=bfields@fieldses.org \
    --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.