aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index ec3462f141b4..dc4a21f1a129 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -125,6 +125,10 @@ static inline void xs_pktdump(char *msg, u32 *packet, unsigned int count)
125} 125}
126#endif 126#endif
127 127
128struct sock_xprt {
129 struct rpc_xprt xprt;
130};
131
128static void xs_format_peer_addresses(struct rpc_xprt *xprt) 132static void xs_format_peer_addresses(struct rpc_xprt *xprt)
129{ 133{
130 struct sockaddr_in *addr = (struct sockaddr_in *) &xprt->addr; 134 struct sockaddr_in *addr = (struct sockaddr_in *) &xprt->addr;
@@ -1343,17 +1347,19 @@ static struct rpc_xprt_ops xs_tcp_ops = {
1343static struct rpc_xprt *xs_setup_xprt(struct sockaddr *addr, size_t addrlen, unsigned int slot_table_size) 1347static struct rpc_xprt *xs_setup_xprt(struct sockaddr *addr, size_t addrlen, unsigned int slot_table_size)
1344{ 1348{
1345 struct rpc_xprt *xprt; 1349 struct rpc_xprt *xprt;
1350 struct sock_xprt *new;
1346 1351
1347 if (addrlen > sizeof(xprt->addr)) { 1352 if (addrlen > sizeof(xprt->addr)) {
1348 dprintk("RPC: xs_setup_xprt: address too large\n"); 1353 dprintk("RPC: xs_setup_xprt: address too large\n");
1349 return ERR_PTR(-EBADF); 1354 return ERR_PTR(-EBADF);
1350 } 1355 }
1351 1356
1352 xprt = kzalloc(sizeof(struct rpc_xprt), GFP_KERNEL); 1357 new = kzalloc(sizeof(*new), GFP_KERNEL);
1353 if (xprt == NULL) { 1358 if (new == NULL) {
1354 dprintk("RPC: xs_setup_xprt: couldn't allocate rpc_xprt\n"); 1359 dprintk("RPC: xs_setup_xprt: couldn't allocate rpc_xprt\n");
1355 return ERR_PTR(-ENOMEM); 1360 return ERR_PTR(-ENOMEM);
1356 } 1361 }
1362 xprt = &new->xprt;
1357 1363
1358 xprt->max_reqs = slot_table_size; 1364 xprt->max_reqs = slot_table_size;
1359 xprt->slot = kcalloc(xprt->max_reqs, sizeof(struct rpc_rqst), GFP_KERNEL); 1365 xprt->slot = kcalloc(xprt->max_reqs, sizeof(struct rpc_rqst), GFP_KERNEL);