Return-Path: Received: from mx2.parallels.com ([64.131.90.16]:55160 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753629Ab1CaHrv (ORCPT ); Thu, 31 Mar 2011 03:47:51 -0400 Message-ID: <4D94319F.8040005@parallels.com> Date: Thu, 31 Mar 2011 02:47:43 -0500 From: Rob Landley To: , , , Trond Myklebust , Tim Spriggs , Kir Kolyshkin , Pavel Emelyanov Subject: [PATCH 2/3] Supply network namespace to rpcbind. Content-Type: text/plain; charset="ISO-8859-1" Sender: linux-nfs-owner@vger.kernel.org List-ID: MIME-Version: 1.0 From: Rob Landley 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 --- 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",