aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/xprt.h1
-rw-r--r--net/sunrpc/clnt.c6
-rw-r--r--net/sunrpc/xprtsock.c23
3 files changed, 9 insertions, 21 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 17f322794e91..f780e72fc417 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -106,7 +106,6 @@ struct rpc_rqst {
106 106
107struct rpc_xprt_ops { 107struct rpc_xprt_ops {
108 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 108 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
109 char * (*print_addr)(struct rpc_xprt *xprt, enum rpc_display_format_t format);
110 int (*reserve_xprt)(struct rpc_task *task); 109 int (*reserve_xprt)(struct rpc_task *task);
111 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 110 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
112 void (*rpcbind)(struct rpc_task *task); 111 void (*rpcbind)(struct rpc_task *task);
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 7d65e19550cc..aba528b9ae76 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -594,7 +594,11 @@ EXPORT_SYMBOL_GPL(rpc_peeraddr);
594char *rpc_peeraddr2str(struct rpc_clnt *clnt, enum rpc_display_format_t format) 594char *rpc_peeraddr2str(struct rpc_clnt *clnt, enum rpc_display_format_t format)
595{ 595{
596 struct rpc_xprt *xprt = clnt->cl_xprt; 596 struct rpc_xprt *xprt = clnt->cl_xprt;
597 return xprt->ops->print_addr(xprt, format); 597
598 if (xprt->address_strings[format] != NULL)
599 return xprt->address_strings[format];
600 else
601 return "unprintable";
598} 602}
599EXPORT_SYMBOL_GPL(rpc_peeraddr2str); 603EXPORT_SYMBOL_GPL(rpc_peeraddr2str);
600 604
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index faa6bfebf258..a94aff42d08c 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1061,19 +1061,6 @@ static unsigned short xs_get_random_port(void)
1061} 1061}
1062 1062
1063/** 1063/**
1064 * xs_print_peer_address - format an IPv4 address for printing
1065 * @xprt: generic transport
1066 * @format: flags field indicating which parts of the address to render
1067 */
1068static char *xs_print_peer_address(struct rpc_xprt *xprt, enum rpc_display_format_t format)
1069{
1070 if (xprt->address_strings[format] != NULL)
1071 return xprt->address_strings[format];
1072 else
1073 return "unprintable";
1074}
1075
1076/**
1077 * xs_set_port - reset the port number in the remote endpoint address 1064 * xs_set_port - reset the port number in the remote endpoint address
1078 * @xprt: generic transport 1065 * @xprt: generic transport
1079 * @port: new port number 1066 * @port: new port number
@@ -1146,7 +1133,7 @@ static void xs_udp_connect_worker(void *args)
1146 } 1133 }
1147 1134
1148 dprintk("RPC: worker connecting xprt %p to address: %s\n", 1135 dprintk("RPC: worker connecting xprt %p to address: %s\n",
1149 xprt, xs_print_peer_address(xprt, RPC_DISPLAY_ALL)); 1136 xprt, xprt->address_strings[RPC_DISPLAY_ALL]);
1150 1137
1151 if (!transport->inet) { 1138 if (!transport->inet) {
1152 struct sock *sk = sock->sk; 1139 struct sock *sk = sock->sk;
@@ -1233,7 +1220,7 @@ static void xs_tcp_connect_worker(void *args)
1233 xs_tcp_reuse_connection(xprt); 1220 xs_tcp_reuse_connection(xprt);
1234 1221
1235 dprintk("RPC: worker connecting xprt %p to address: %s\n", 1222 dprintk("RPC: worker connecting xprt %p to address: %s\n",
1236 xprt, xs_print_peer_address(xprt, RPC_DISPLAY_ALL)); 1223 xprt, xprt->address_strings[RPC_DISPLAY_ALL]);
1237 1224
1238 if (!transport->inet) { 1225 if (!transport->inet) {
1239 struct sock *sk = sock->sk; 1226 struct sock *sk = sock->sk;
@@ -1380,7 +1367,6 @@ static void xs_tcp_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
1380 1367
1381static struct rpc_xprt_ops xs_udp_ops = { 1368static struct rpc_xprt_ops xs_udp_ops = {
1382 .set_buffer_size = xs_udp_set_buffer_size, 1369 .set_buffer_size = xs_udp_set_buffer_size,
1383 .print_addr = xs_print_peer_address,
1384 .reserve_xprt = xprt_reserve_xprt_cong, 1370 .reserve_xprt = xprt_reserve_xprt_cong,
1385 .release_xprt = xprt_release_xprt_cong, 1371 .release_xprt = xprt_release_xprt_cong,
1386 .rpcbind = rpc_getport, 1372 .rpcbind = rpc_getport,
@@ -1398,7 +1384,6 @@ static struct rpc_xprt_ops xs_udp_ops = {
1398}; 1384};
1399 1385
1400static struct rpc_xprt_ops xs_tcp_ops = { 1386static struct rpc_xprt_ops xs_tcp_ops = {
1401 .print_addr = xs_print_peer_address,
1402 .reserve_xprt = xprt_reserve_xprt, 1387 .reserve_xprt = xprt_reserve_xprt,
1403 .release_xprt = xs_tcp_release_xprt, 1388 .release_xprt = xs_tcp_release_xprt,
1404 .rpcbind = rpc_getport, 1389 .rpcbind = rpc_getport,
@@ -1485,7 +1470,7 @@ struct rpc_xprt *xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_
1485 1470
1486 xs_format_peer_addresses(xprt); 1471 xs_format_peer_addresses(xprt);
1487 dprintk("RPC: set up transport to address %s\n", 1472 dprintk("RPC: set up transport to address %s\n",
1488 xs_print_peer_address(xprt, RPC_DISPLAY_ALL)); 1473 xprt->address_strings[RPC_DISPLAY_ALL]);
1489 1474
1490 return xprt; 1475 return xprt;
1491} 1476}
@@ -1529,7 +1514,7 @@ struct rpc_xprt *xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_
1529 1514
1530 xs_format_peer_addresses(xprt); 1515 xs_format_peer_addresses(xprt);
1531 dprintk("RPC: set up transport to address %s\n", 1516 dprintk("RPC: set up transport to address %s\n",
1532 xs_print_peer_address(xprt, RPC_DISPLAY_ALL)); 1517 xprt->address_strings[RPC_DISPLAY_ALL]);
1533 1518
1534 return xprt; 1519 return xprt;
1535} 1520}