aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2010-09-29 08:05:43 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-10-01 17:18:58 -0400
commit37aa2133731d9231eb834f700119f0d3f1ed2664 (patch)
tree2b4da236e76d590fb1bd675e4401af5d1ecff327 /net/sunrpc
parent9a23e332ec621d36e52cc7a978abc0917067b1aa (diff)
sunrpc: Tag rpc_xprt with net
The net is known from the xprt_create and this tagging will also give un the context in the conntection workers where real sockets are created. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprt.c4
-rw-r--r--net/sunrpc/xprtrdma/transport.c2
-rw-r--r--net/sunrpc/xprtsock.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 0637340e5342..953206d8c6c2 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -962,7 +962,7 @@ static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req)
962 spin_unlock(&xprt->reserve_lock); 962 spin_unlock(&xprt->reserve_lock);
963} 963}
964 964
965struct rpc_xprt *xprt_alloc(int size, int max_req) 965struct rpc_xprt *xprt_alloc(struct net *net, int size, int max_req)
966{ 966{
967 struct rpc_xprt *xprt; 967 struct rpc_xprt *xprt;
968 968
@@ -975,6 +975,7 @@ struct rpc_xprt *xprt_alloc(int size, int max_req)
975 if (xprt->slot == NULL) 975 if (xprt->slot == NULL)
976 goto out_free; 976 goto out_free;
977 977
978 xprt->xprt_net = get_net(net);
978 return xprt; 979 return xprt;
979 980
980out_free: 981out_free:
@@ -986,6 +987,7 @@ EXPORT_SYMBOL_GPL(xprt_alloc);
986 987
987void xprt_free(struct rpc_xprt *xprt) 988void xprt_free(struct rpc_xprt *xprt)
988{ 989{
990 put_net(xprt->xprt_net);
989 kfree(xprt->slot); 991 kfree(xprt->slot);
990 kfree(xprt); 992 kfree(xprt);
991} 993}
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 0f7a1b9d05ad..2da32b40bfcf 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -283,7 +283,7 @@ xprt_setup_rdma(struct xprt_create *args)
283 return ERR_PTR(-EBADF); 283 return ERR_PTR(-EBADF);
284 } 284 }
285 285
286 xprt = xprt_alloc(sizeof(struct rpcrdma_xprt), 286 xprt = xprt_alloc(args->net, sizeof(struct rpcrdma_xprt),
287 xprt_rdma_slot_table_entries); 287 xprt_rdma_slot_table_entries);
288 if (xprt == NULL) { 288 if (xprt == NULL) {
289 dprintk("RPC: %s: couldn't allocate rpcrdma_xprt\n", 289 dprintk("RPC: %s: couldn't allocate rpcrdma_xprt\n",
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index b1e36ec6fd80..4ef3a6a9445c 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2272,7 +2272,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
2272 return ERR_PTR(-EBADF); 2272 return ERR_PTR(-EBADF);
2273 } 2273 }
2274 2274
2275 xprt = xprt_alloc(sizeof(*new), slot_table_size); 2275 xprt = xprt_alloc(args->net, sizeof(*new), slot_table_size);
2276 if (xprt == NULL) { 2276 if (xprt == NULL) {
2277 dprintk("RPC: xs_setup_xprt: couldn't allocate " 2277 dprintk("RPC: xs_setup_xprt: couldn't allocate "
2278 "rpc_xprt\n"); 2278 "rpc_xprt\n");