aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/clnt.h4
-rw-r--r--net/sunrpc/rpcb_clnt.c7
-rw-r--r--net/sunrpc/svc.c4
3 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index b0b3e572a619..e891a8a18cb3 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -136,8 +136,8 @@ void rpc_shutdown_client(struct rpc_clnt *);
136void rpc_release_client(struct rpc_clnt *); 136void rpc_release_client(struct rpc_clnt *);
137void rpc_task_release_client(struct rpc_task *); 137void rpc_task_release_client(struct rpc_task *);
138 138
139int rpcb_create_local(void); 139int rpcb_create_local(struct net *);
140void rpcb_put_local(void); 140void rpcb_put_local(struct net *);
141int rpcb_register(struct net *, u32, u32, int, unsigned short); 141int rpcb_register(struct net *, u32, u32, int, unsigned short);
142int rpcb_v4_register(struct net *net, const u32 program, 142int rpcb_v4_register(struct net *net, const u32 program,
143 const u32 version, 143 const u32 version,
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
178void rpcb_put_local(void) 178void 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 */
326int rpcb_create_local(void) 326int 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;
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 889d7b11b9ac..0aee925fbd73 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -372,7 +372,7 @@ static int svc_rpcb_setup(struct svc_serv *serv)
372{ 372{
373 int err; 373 int err;
374 374
375 err = rpcb_create_local(); 375 err = rpcb_create_local(&init_net);
376 if (err) 376 if (err)
377 return err; 377 return err;
378 378
@@ -384,7 +384,7 @@ static int svc_rpcb_setup(struct svc_serv *serv)
384void svc_rpcb_cleanup(struct svc_serv *serv) 384void svc_rpcb_cleanup(struct svc_serv *serv)
385{ 385{
386 svc_unregister(serv); 386 svc_unregister(serv);
387 rpcb_put_local(); 387 rpcb_put_local(&init_net);
388} 388}
389EXPORT_SYMBOL_GPL(svc_rpcb_cleanup); 389EXPORT_SYMBOL_GPL(svc_rpcb_cleanup);
390 390