]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
sunrpc: Tag svc_xprt with net
authorPavel Emelyanov <xemul@parallels.com>
Mon, 27 Sep 2010 10:00:49 +0000 (14:00 +0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 27 Sep 2010 14:16:12 +0000 (10:16 -0400)
The transport representation should be per-net of course.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/linux/sunrpc/svc_xprt.h
net/sunrpc/svc_xprt.c

index 5f4e18b3ce73d3b5000b46d633d2eaa7af38c13d..e50e3eca1c7cc1f359112679e69d9645be4d0e5e 100644 (file)
@@ -66,6 +66,8 @@ struct svc_xprt {
        struct sockaddr_storage xpt_remote;     /* remote peer's address */
        size_t                  xpt_remotelen;  /* length of address */
        struct rpc_wait_queue   xpt_bc_pending; /* backchannel wait queue */
+
+       struct net              *xpt_net;
 };
 
 int    svc_reg_xprt_class(struct svc_xprt_class *);
index 385d822419ca9f367e83582d2751e6af78a672ea..f7e8915051b1cabb1732e23cc268ebaa21c7c9ab 100644 (file)
@@ -130,6 +130,7 @@ static void svc_xprt_free(struct kref *kref)
        struct module *owner = xprt->xpt_class->xcl_owner;
        if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags))
                svcauth_unix_info_release(xprt);
+       put_net(xprt->xpt_net);
        xprt->xpt_ops->xpo_free(xprt);
        module_put(owner);
 }
@@ -159,6 +160,7 @@ void svc_xprt_init(struct svc_xprt_class *xcl, struct svc_xprt *xprt,
        spin_lock_init(&xprt->xpt_lock);
        set_bit(XPT_BUSY, &xprt->xpt_flags);
        rpc_init_wait_queue(&xprt->xpt_bc_pending, "xpt_bc_pending");
+       xprt->xpt_net = get_net(&init_net);
 }
 EXPORT_SYMBOL_GPL(svc_xprt_init);