[PATCH] SUNRPC: Clean up: rename sock_xprt's addr field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The usual convention is to use the name "addr" for fields that store
destination addresses in the RPC client.  The sock_xprt's addr field is
a socket's source address, not a destination address.

Clean up: rename this field in order to make it less confusing.

Note that the client-side RDMA transport doesn't copy out the source
address field passed in from xprt_create_transport(); it doesn't need to do
this yet, but perhaps it should if rpcbind and NLM over RDMA are ever
implemented.

Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
---
A singleton clean-up patch for 2.6.26.  Cc: linux-nfs for those of you
following along at home.
---

 net/sunrpc/xprtsock.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 8bd3b0f..560fff1 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -240,7 +240,7 @@ struct sock_xprt {
 	 * Connection of transports
 	 */
 	struct delayed_work	connect_worker;
-	struct sockaddr_storage	addr;
+	struct sockaddr_storage	source_address;
 	unsigned short		port;
 
 	/*
@@ -1344,7 +1344,7 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock)
 	unsigned short port = xs_get_srcport(transport, sock);
 	unsigned short last;
 
-	sa = (struct sockaddr_in *)&transport->addr;
+	sa = (struct sockaddr_in *)&transport->source_address;
 	myaddr.sin_addr = sa->sin_addr;
 	do {
 		myaddr.sin_port = htons(port);
@@ -1377,7 +1377,7 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock)
 	unsigned short port = xs_get_srcport(transport, sock);
 	unsigned short last;
 
-	sa = (struct sockaddr_in6 *)&transport->addr;
+	sa = (struct sockaddr_in6 *)&transport->source_address;
 	myaddr.sin6_addr = sa->sin6_addr;
 	do {
 		myaddr.sin6_port = htons(port);
@@ -1885,7 +1885,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
 	memcpy(&xprt->addr, args->dstaddr, args->addrlen);
 	xprt->addrlen = args->addrlen;
 	if (args->srcaddr)
-		memcpy(&new->addr, args->srcaddr, args->addrlen);
+		memcpy(&new->source_address, args->srcaddr, args->addrlen);
 
 	return xprt;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux