[PATCH 6/8] sunrpc: Tag rpc_xprt with net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The net is known from the xprt_create and this tagging will also
give us the context in the connection workers where real sockets
are created.

Signed-off-by: Pavel Emelyanov <xemul@xxxxxxxxxx>
---
 include/linux/sunrpc/xprt.h |    1 +
 net/sunrpc/xprtsock.c       |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index cd27538..83ae00a 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -224,6 +224,7 @@ struct rpc_xprt {
 					bklog_u;	/* backlog queue utilization */
 	} stat;
 
+	struct net		*xprt_net;
 	const char		*address_strings[RPC_DISPLAY_MAX];
 };
 
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 98d4b7b..292f449 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2296,11 +2296,13 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
 	if (args->srcaddr)
 		memcpy(&new->srcaddr, args->srcaddr, args->addrlen);
 
+	xprt->xprt_net = get_net(args->net);
 	return xprt;
 }
 
 static void xs_free_xprt(struct rpc_xprt *xprt)
 {
+	put_net(xprt->xprt_net);
 	kfree(xprt->slot);
 	kfree(xprt);
 }
-- 
1.5.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux