diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-08-09 15:09:46 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:09:46 -0400 |
commit | fbfffbd5e74c5fa8c9165e110cb5899ec21e6364 (patch) | |
tree | 85d4c8a589e9796fe0b347b021db0a19d499b81d /net/sunrpc | |
parent | f8b761eff1e49fde43dd940ac32b38cf7cee2a95 (diff) |
SUNRPC: Rename sock_xprt.addr as sock_xprt.srcaddr
Clean up: Give the "addr" and "port" field less ambiguous names.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/xprtsock.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 302a40904923..7bc3c178ccb3 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -248,8 +248,8 @@ struct sock_xprt { | |||
248 | * Connection of transports | 248 | * Connection of transports |
249 | */ | 249 | */ |
250 | struct delayed_work connect_worker; | 250 | struct delayed_work connect_worker; |
251 | struct sockaddr_storage addr; | 251 | struct sockaddr_storage srcaddr; |
252 | unsigned short port; | 252 | unsigned short srcport; |
253 | 253 | ||
254 | /* | 254 | /* |
255 | * UDP socket buffer size parameters | 255 | * UDP socket buffer size parameters |
@@ -1546,7 +1546,7 @@ static void xs_set_port(struct rpc_xprt *xprt, unsigned short port) | |||
1546 | 1546 | ||
1547 | static unsigned short xs_get_srcport(struct sock_xprt *transport, struct socket *sock) | 1547 | static unsigned short xs_get_srcport(struct sock_xprt *transport, struct socket *sock) |
1548 | { | 1548 | { |
1549 | unsigned short port = transport->port; | 1549 | unsigned short port = transport->srcport; |
1550 | 1550 | ||
1551 | if (port == 0 && transport->xprt.resvport) | 1551 | if (port == 0 && transport->xprt.resvport) |
1552 | port = xs_get_random_port(); | 1552 | port = xs_get_random_port(); |
@@ -1555,8 +1555,8 @@ static unsigned short xs_get_srcport(struct sock_xprt *transport, struct socket | |||
1555 | 1555 | ||
1556 | static unsigned short xs_next_srcport(struct sock_xprt *transport, struct socket *sock, unsigned short port) | 1556 | static unsigned short xs_next_srcport(struct sock_xprt *transport, struct socket *sock, unsigned short port) |
1557 | { | 1557 | { |
1558 | if (transport->port != 0) | 1558 | if (transport->srcport != 0) |
1559 | transport->port = 0; | 1559 | transport->srcport = 0; |
1560 | if (!transport->xprt.resvport) | 1560 | if (!transport->xprt.resvport) |
1561 | return 0; | 1561 | return 0; |
1562 | if (port <= xprt_min_resvport || port > xprt_max_resvport) | 1562 | if (port <= xprt_min_resvport || port > xprt_max_resvport) |
@@ -1574,7 +1574,7 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock) | |||
1574 | unsigned short port = xs_get_srcport(transport, sock); | 1574 | unsigned short port = xs_get_srcport(transport, sock); |
1575 | unsigned short last; | 1575 | unsigned short last; |
1576 | 1576 | ||
1577 | sa = (struct sockaddr_in *)&transport->addr; | 1577 | sa = (struct sockaddr_in *)&transport->srcaddr; |
1578 | myaddr.sin_addr = sa->sin_addr; | 1578 | myaddr.sin_addr = sa->sin_addr; |
1579 | do { | 1579 | do { |
1580 | myaddr.sin_port = htons(port); | 1580 | myaddr.sin_port = htons(port); |
@@ -1583,7 +1583,7 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock) | |||
1583 | if (port == 0) | 1583 | if (port == 0) |
1584 | break; | 1584 | break; |
1585 | if (err == 0) { | 1585 | if (err == 0) { |
1586 | transport->port = port; | 1586 | transport->srcport = port; |
1587 | break; | 1587 | break; |
1588 | } | 1588 | } |
1589 | last = port; | 1589 | last = port; |
@@ -1607,7 +1607,7 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock) | |||
1607 | unsigned short port = xs_get_srcport(transport, sock); | 1607 | unsigned short port = xs_get_srcport(transport, sock); |
1608 | unsigned short last; | 1608 | unsigned short last; |
1609 | 1609 | ||
1610 | sa = (struct sockaddr_in6 *)&transport->addr; | 1610 | sa = (struct sockaddr_in6 *)&transport->srcaddr; |
1611 | myaddr.sin6_addr = sa->sin6_addr; | 1611 | myaddr.sin6_addr = sa->sin6_addr; |
1612 | do { | 1612 | do { |
1613 | myaddr.sin6_port = htons(port); | 1613 | myaddr.sin6_port = htons(port); |
@@ -1616,7 +1616,7 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock) | |||
1616 | if (port == 0) | 1616 | if (port == 0) |
1617 | break; | 1617 | break; |
1618 | if (err == 0) { | 1618 | if (err == 0) { |
1619 | transport->port = port; | 1619 | transport->srcport = port; |
1620 | break; | 1620 | break; |
1621 | } | 1621 | } |
1622 | last = port; | 1622 | last = port; |
@@ -2061,7 +2061,7 @@ static void xs_udp_print_stats(struct rpc_xprt *xprt, struct seq_file *seq) | |||
2061 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 2061 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
2062 | 2062 | ||
2063 | seq_printf(seq, "\txprt:\tudp %u %lu %lu %lu %lu %Lu %Lu\n", | 2063 | seq_printf(seq, "\txprt:\tudp %u %lu %lu %lu %lu %Lu %Lu\n", |
2064 | transport->port, | 2064 | transport->srcport, |
2065 | xprt->stat.bind_count, | 2065 | xprt->stat.bind_count, |
2066 | xprt->stat.sends, | 2066 | xprt->stat.sends, |
2067 | xprt->stat.recvs, | 2067 | xprt->stat.recvs, |
@@ -2085,7 +2085,7 @@ static void xs_tcp_print_stats(struct rpc_xprt *xprt, struct seq_file *seq) | |||
2085 | idle_time = (long)(jiffies - xprt->last_used) / HZ; | 2085 | idle_time = (long)(jiffies - xprt->last_used) / HZ; |
2086 | 2086 | ||
2087 | seq_printf(seq, "\txprt:\ttcp %u %lu %lu %lu %ld %lu %lu %lu %Lu %Lu\n", | 2087 | seq_printf(seq, "\txprt:\ttcp %u %lu %lu %lu %ld %lu %lu %lu %Lu %Lu\n", |
2088 | transport->port, | 2088 | transport->srcport, |
2089 | xprt->stat.bind_count, | 2089 | xprt->stat.bind_count, |
2090 | xprt->stat.connect_count, | 2090 | xprt->stat.connect_count, |
2091 | xprt->stat.connect_time, | 2091 | xprt->stat.connect_time, |
@@ -2164,7 +2164,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args, | |||
2164 | memcpy(&xprt->addr, args->dstaddr, args->addrlen); | 2164 | memcpy(&xprt->addr, args->dstaddr, args->addrlen); |
2165 | xprt->addrlen = args->addrlen; | 2165 | xprt->addrlen = args->addrlen; |
2166 | if (args->srcaddr) | 2166 | if (args->srcaddr) |
2167 | memcpy(&new->addr, args->srcaddr, args->addrlen); | 2167 | memcpy(&new->srcaddr, args->srcaddr, args->addrlen); |
2168 | 2168 | ||
2169 | return xprt; | 2169 | return xprt; |
2170 | } | 2170 | } |