All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rlandley@parallels.com>
To: <linux-kernel@vger.kernel.org>, <linux-nfs@vger.kernel.org>,
	<containers@lists.linux-foundation.org>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	Tim Spriggs <tims@uahirise.org>,
	Kir Kolyshkin <kir@parallels.com>,
	Pavel Emelyanov <xemul@parallels.com>
Subject: [PATCH 2/3] Supply network namespace to rpcbind.
Date: Thu, 31 Mar 2011 02:47:43 -0500	[thread overview]
Message-ID: <4D94319F.8040005@parallels.com> (raw)

From: Rob Landley <rlandley@parallels.com>

The sunrpc code already has some support for network namespaces,
but rpcb_create() is still using init_net.  Its arguments include
a sockaddr and a port, but not a struct net *.  Add one, and
pass in the value from rpc_xprt when calling it.

Signed-off-by: Rob Landley <rlandley@parallels.com>
---

 net/sunrpc/rpcb_clnt.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index c652e4c..25bb8f9 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -223,10 +223,11 @@ out:
 }
 
 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
-				    size_t salen, int proto, u32 version)
+				    size_t salen, int proto, struct net *net,
+				    u32 version)
 {
 	struct rpc_create_args args = {
-		.net		= &init_net,
+		.net		= net,
 		.protocol	= proto,
 		.address	= srvaddr,
 		.addrsize	= salen,
@@ -591,7 +592,7 @@ void rpcb_getport_async(struct rpc_task *task)
 		task->tk_pid, __func__, bind_version);
 
 	rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
-				bind_version);
+				xprt->xprt_net, bind_version);
 	if (IS_ERR(rpcb_clnt)) {
 		status = PTR_ERR(rpcb_clnt);
 		dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",

             reply	other threads:[~2011-03-31  7:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31  7:47 Rob Landley [this message]
     [not found] ` <4D94319F.8040005-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-04-05  3:01   ` [PATCH 2/3] Supply network namespace to rpcbind Serge E. Hallyn
2011-04-06  0:57   ` Kirill A. Shutemov
2011-04-05  3:01 ` Serge E. Hallyn
2011-04-06  0:57 ` Kirill A. Shutemov
2011-04-06 11:48   ` Rob Landley
     [not found]   ` <20110406005743.GB27844-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-04-06 11:48     ` Rob Landley
  -- strict thread matches above, loose matches on Subject: below --
2011-03-31  7:47 Rob Landley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D94319F.8040005@parallels.com \
    --to=rlandley@parallels.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=kir@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tims@uahirise.org \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.