diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-13 03:52:51 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-31 19:28:11 -0500 |
commit | f7a30c18e8d673c996095420a026a28433cb4096 (patch) | |
tree | a5f84a1fed803c837be1570b0faa073219fdc399 /net/sunrpc/rpcb_clnt.c | |
parent | 977ac3157328239a0f4074b13a3d9eb5c832cd6c (diff) |
SUNRPC: parametrize local rpcbind clients creation with net ns
These client are per network namespace and thus can be created for different
network namespaces.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index a5aa50d0aae4..6d6a84f67449 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) | |||
175 | return cnt; | 175 | return cnt; |
176 | } | 176 | } |
177 | 177 | ||
178 | void rpcb_put_local(void) | 178 | void rpcb_put_local(struct net *net) |
179 | { | 179 | { |
180 | struct sunrpc_net *sn = net_generic(&init_net, sunrpc_net_id); | 180 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); |
181 | struct rpc_clnt *clnt = sn->rpcb_local_clnt; | 181 | struct rpc_clnt *clnt = sn->rpcb_local_clnt; |
182 | struct rpc_clnt *clnt4 = sn->rpcb_local_clnt4; | 182 | struct rpc_clnt *clnt4 = sn->rpcb_local_clnt4; |
183 | int shutdown; | 183 | int shutdown; |
@@ -323,11 +323,10 @@ out: | |||
323 | * Returns zero on success, otherwise a negative errno value | 323 | * Returns zero on success, otherwise a negative errno value |
324 | * is returned. | 324 | * is returned. |
325 | */ | 325 | */ |
326 | int rpcb_create_local(void) | 326 | int rpcb_create_local(struct net *net) |
327 | { | 327 | { |
328 | static DEFINE_MUTEX(rpcb_create_local_mutex); | 328 | static DEFINE_MUTEX(rpcb_create_local_mutex); |
329 | int result = 0; | 329 | int result = 0; |
330 | struct net *net = &init_net; | ||
331 | 330 | ||
332 | if (rpcb_get_local(net)) | 331 | if (rpcb_get_local(net)) |
333 | return result; | 332 | return result; |