diff options
-rw-r--r-- | include/linux/sunrpc/clnt.h | 4 | ||||
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 7 | ||||
-rw-r--r-- | 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 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 *); | |||
136 | void rpc_release_client(struct rpc_clnt *); | 136 | void rpc_release_client(struct rpc_clnt *); |
137 | void rpc_task_release_client(struct rpc_task *); | 137 | void rpc_task_release_client(struct rpc_task *); |
138 | 138 | ||
139 | int rpcb_create_local(void); | 139 | int rpcb_create_local(struct net *); |
140 | void rpcb_put_local(void); | 140 | void rpcb_put_local(struct net *); |
141 | int rpcb_register(struct net *, u32, u32, int, unsigned short); | 141 | int rpcb_register(struct net *, u32, u32, int, unsigned short); |
142 | int rpcb_v4_register(struct net *net, const u32 program, | 142 | int 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 | ||
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; |
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) | |||
384 | void svc_rpcb_cleanup(struct svc_serv *serv) | 384 | void 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 | } |
389 | EXPORT_SYMBOL_GPL(svc_rpcb_cleanup); | 389 | EXPORT_SYMBOL_GPL(svc_rpcb_cleanup); |
390 | 390 | ||