From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, xemul@parallels.com, neilb@suse.de,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jbottomley@parallels.com, bfields@fieldses.org,
davem@davemloft.net, devel@openvz.org
Subject: [PATCH v5 6/6] SUNRPC: parametrize local rpcbind clients creation with net ns
Date: Fri, 13 Jan 2012 12:52:51 +0400 [thread overview]
Message-ID: <20120113085251.31750.74257.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20120113084545.31750.83655.stgit@localhost6.localdomain6>
These client are per network namespace and thus can be created for different
network namespaces.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
include/linux/sunrpc/clnt.h | 4 ++--
net/sunrpc/rpcb_clnt.c | 7 +++----
net/sunrpc/svc.c | 4 ++--
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index b0b3e57..e891a8a 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -136,8 +136,8 @@ void rpc_shutdown_client(struct rpc_clnt *);
void rpc_release_client(struct rpc_clnt *);
void rpc_task_release_client(struct rpc_task *);
-int rpcb_create_local(void);
-void rpcb_put_local(void);
+int rpcb_create_local(struct net *);
+void rpcb_put_local(struct net *);
int rpcb_register(struct net *, u32, u32, int, unsigned short);
int rpcb_v4_register(struct net *net, const u32 program,
const u32 version,
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index a5aa50d..6d6a84f 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -175,9 +175,9 @@ static int rpcb_get_local(struct net *net)
return cnt;
}
-void rpcb_put_local(void)
+void rpcb_put_local(struct net *net)
{
- struct sunrpc_net *sn = net_generic(&init_net, sunrpc_net_id);
+ struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
struct rpc_clnt *clnt = sn->rpcb_local_clnt;
struct rpc_clnt *clnt4 = sn->rpcb_local_clnt4;
int shutdown;
@@ -323,11 +323,10 @@ out:
* Returns zero on success, otherwise a negative errno value
* is returned.
*/
-int rpcb_create_local(void)
+int rpcb_create_local(struct net *net)
{
static DEFINE_MUTEX(rpcb_create_local_mutex);
int result = 0;
- struct net *net = &init_net;
if (rpcb_get_local(net))
return result;
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index aa0041a..8f6c255 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -370,7 +370,7 @@ static int svc_rpcb_setup(struct svc_serv *serv)
{
int err;
- err = rpcb_create_local();
+ err = rpcb_create_local(&init_net);
if (err)
return err;
@@ -382,7 +382,7 @@ static int svc_rpcb_setup(struct svc_serv *serv)
void svc_rpcb_cleanup(struct svc_serv *serv)
{
svc_unregister(serv);
- rpcb_put_local();
+ rpcb_put_local(&init_net);
}
EXPORT_SYMBOL_GPL(svc_rpcb_cleanup);
next prev parent reply other threads:[~2012-01-13 8:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-13 8:52 [PATCH v5 0/6] SUNRPC: rcbind clients virtualization Stanislav Kinsbursky
2012-01-13 8:52 ` [PATCH v5 1/6] SUNRPC: move rpcbind internals to sunrpc part of network namespace context Stanislav Kinsbursky
2012-01-13 8:52 ` [PATCH v5 2/6] SUNRPC: optimize net_ns dereferencing in rpcbind creation calls Stanislav Kinsbursky
2012-01-13 8:52 ` [PATCH v5 3/6] SUNRPC: optimize net_ns dereferencing in rpcbind registering calls Stanislav Kinsbursky
2012-01-13 8:52 ` [PATCH v5 4/6] SUNRPC: create rpcbind client in passed network namespace context Stanislav Kinsbursky
2012-01-13 8:52 ` [PATCH v5 5/6] SUNRPC: register rpcbind programs in passed network namespase context Stanislav Kinsbursky
2012-01-13 8:52 ` Stanislav Kinsbursky [this message]
2012-01-13 10:03 ` [PATCH v5 0/6] SUNRPC: rcbind clients virtualization Stanislav Kinsbursky
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=20120113085251.31750.74257.stgit@localhost6.localdomain6 \
--to=skinsbursky@parallels.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=jbottomley@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).