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>
This commit is contained in:
parent
f8b761eff1
commit
fbfffbd5e7
1 changed files with 12 additions and 12 deletions
|
@ -248,8 +248,8 @@ struct sock_xprt {
|
||||||
* Connection of transports
|
* Connection of transports
|
||||||
*/
|
*/
|
||||||
struct delayed_work connect_worker;
|
struct delayed_work connect_worker;
|
||||||
struct sockaddr_storage addr;
|
struct sockaddr_storage srcaddr;
|
||||||
unsigned short port;
|
unsigned short srcport;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* UDP socket buffer size parameters
|
* UDP socket buffer size parameters
|
||||||
|
@ -1546,7 +1546,7 @@ static void xs_set_port(struct rpc_xprt *xprt, unsigned short port)
|
||||||
|
|
||||||
static unsigned short xs_get_srcport(struct sock_xprt *transport, struct socket *sock)
|
static unsigned short xs_get_srcport(struct sock_xprt *transport, struct socket *sock)
|
||||||
{
|
{
|
||||||
unsigned short port = transport->port;
|
unsigned short port = transport->srcport;
|
||||||
|
|
||||||
if (port == 0 && transport->xprt.resvport)
|
if (port == 0 && transport->xprt.resvport)
|
||||||
port = xs_get_random_port();
|
port = xs_get_random_port();
|
||||||
|
@ -1555,8 +1555,8 @@ static unsigned short xs_get_srcport(struct sock_xprt *transport, struct socket
|
||||||
|
|
||||||
static unsigned short xs_next_srcport(struct sock_xprt *transport, struct socket *sock, unsigned short port)
|
static unsigned short xs_next_srcport(struct sock_xprt *transport, struct socket *sock, unsigned short port)
|
||||||
{
|
{
|
||||||
if (transport->port != 0)
|
if (transport->srcport != 0)
|
||||||
transport->port = 0;
|
transport->srcport = 0;
|
||||||
if (!transport->xprt.resvport)
|
if (!transport->xprt.resvport)
|
||||||
return 0;
|
return 0;
|
||||||
if (port <= xprt_min_resvport || port > xprt_max_resvport)
|
if (port <= xprt_min_resvport || port > xprt_max_resvport)
|
||||||
|
@ -1574,7 +1574,7 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock)
|
||||||
unsigned short port = xs_get_srcport(transport, sock);
|
unsigned short port = xs_get_srcport(transport, sock);
|
||||||
unsigned short last;
|
unsigned short last;
|
||||||
|
|
||||||
sa = (struct sockaddr_in *)&transport->addr;
|
sa = (struct sockaddr_in *)&transport->srcaddr;
|
||||||
myaddr.sin_addr = sa->sin_addr;
|
myaddr.sin_addr = sa->sin_addr;
|
||||||
do {
|
do {
|
||||||
myaddr.sin_port = htons(port);
|
myaddr.sin_port = htons(port);
|
||||||
|
@ -1583,7 +1583,7 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock)
|
||||||
if (port == 0)
|
if (port == 0)
|
||||||
break;
|
break;
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
transport->port = port;
|
transport->srcport = port;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
last = port;
|
last = port;
|
||||||
|
@ -1607,7 +1607,7 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock)
|
||||||
unsigned short port = xs_get_srcport(transport, sock);
|
unsigned short port = xs_get_srcport(transport, sock);
|
||||||
unsigned short last;
|
unsigned short last;
|
||||||
|
|
||||||
sa = (struct sockaddr_in6 *)&transport->addr;
|
sa = (struct sockaddr_in6 *)&transport->srcaddr;
|
||||||
myaddr.sin6_addr = sa->sin6_addr;
|
myaddr.sin6_addr = sa->sin6_addr;
|
||||||
do {
|
do {
|
||||||
myaddr.sin6_port = htons(port);
|
myaddr.sin6_port = htons(port);
|
||||||
|
@ -1616,7 +1616,7 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock)
|
||||||
if (port == 0)
|
if (port == 0)
|
||||||
break;
|
break;
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
transport->port = port;
|
transport->srcport = port;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
last = port;
|
last = port;
|
||||||
|
@ -2061,7 +2061,7 @@ static void xs_udp_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
|
||||||
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
|
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
|
||||||
|
|
||||||
seq_printf(seq, "\txprt:\tudp %u %lu %lu %lu %lu %Lu %Lu\n",
|
seq_printf(seq, "\txprt:\tudp %u %lu %lu %lu %lu %Lu %Lu\n",
|
||||||
transport->port,
|
transport->srcport,
|
||||||
xprt->stat.bind_count,
|
xprt->stat.bind_count,
|
||||||
xprt->stat.sends,
|
xprt->stat.sends,
|
||||||
xprt->stat.recvs,
|
xprt->stat.recvs,
|
||||||
|
@ -2085,7 +2085,7 @@ static void xs_tcp_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
|
||||||
idle_time = (long)(jiffies - xprt->last_used) / HZ;
|
idle_time = (long)(jiffies - xprt->last_used) / HZ;
|
||||||
|
|
||||||
seq_printf(seq, "\txprt:\ttcp %u %lu %lu %lu %ld %lu %lu %lu %Lu %Lu\n",
|
seq_printf(seq, "\txprt:\ttcp %u %lu %lu %lu %ld %lu %lu %lu %Lu %Lu\n",
|
||||||
transport->port,
|
transport->srcport,
|
||||||
xprt->stat.bind_count,
|
xprt->stat.bind_count,
|
||||||
xprt->stat.connect_count,
|
xprt->stat.connect_count,
|
||||||
xprt->stat.connect_time,
|
xprt->stat.connect_time,
|
||||||
|
@ -2164,7 +2164,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
|
||||||
memcpy(&xprt->addr, args->dstaddr, args->addrlen);
|
memcpy(&xprt->addr, args->dstaddr, args->addrlen);
|
||||||
xprt->addrlen = args->addrlen;
|
xprt->addrlen = args->addrlen;
|
||||||
if (args->srcaddr)
|
if (args->srcaddr)
|
||||||
memcpy(&new->addr, args->srcaddr, args->addrlen);
|
memcpy(&new->srcaddr, args->srcaddr, args->addrlen);
|
||||||
|
|
||||||
return xprt;
|
return xprt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue