aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-12-10 04:19:14 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-12-10 16:25:33 -0500
commitdb42d1a76a8dfcaba7a2dc9c591fa4e231db22b3 (patch)
tree28f1532fcae99b21ee98ea79c5108914fdaa762f
parentdb6e182c17cb1a7069f7f8924721ce58ac05d9a3 (diff)
nfsd: pass net to nfsd_startup() and nfsd_shutdown()
Precursor patch. Hard-coded "init_net" will be replaced by proper one in future. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfssvc.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 9fd8496d5b84..21cba3d7c865 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -203,10 +203,9 @@ static int nfsd_init_socks(struct net *net)
203 203
204static bool nfsd_up = false; 204static bool nfsd_up = false;
205 205
206static int nfsd_startup(int nrservs) 206static int nfsd_startup(int nrservs, struct net *net)
207{ 207{
208 int ret; 208 int ret;
209 struct net *net = &init_net;
210 209
211 if (nfsd_up) 210 if (nfsd_up)
212 return 0; 211 return 0;
@@ -237,16 +236,14 @@ static int nfsd_startup(int nrservs)
237out_net_state: 236out_net_state:
238 nfs4_state_shutdown(); 237 nfs4_state_shutdown();
239out_lockd: 238out_lockd:
240 lockd_down(&init_net); 239 lockd_down(net);
241out_racache: 240out_racache:
242 nfsd_racache_shutdown(); 241 nfsd_racache_shutdown();
243 return ret; 242 return ret;
244} 243}
245 244
246static void nfsd_shutdown(void) 245static void nfsd_shutdown(struct net *net)
247{ 246{
248 struct net *net = &init_net;
249
250 /* 247 /*
251 * write_ports can create the server without actually starting 248 * write_ports can create the server without actually starting
252 * any threads--if we get shut down before any threads are 249 * any threads--if we get shut down before any threads are
@@ -264,7 +261,7 @@ static void nfsd_shutdown(void)
264 261
265static void nfsd_last_thread(struct svc_serv *serv, struct net *net) 262static void nfsd_last_thread(struct svc_serv *serv, struct net *net)
266{ 263{
267 nfsd_shutdown(); 264 nfsd_shutdown(net);
268 265
269 svc_rpcb_cleanup(serv, net); 266 svc_rpcb_cleanup(serv, net);
270 267
@@ -468,7 +465,7 @@ nfsd_svc(int nrservs)
468 465
469 nfsd_up_before = nfsd_up; 466 nfsd_up_before = nfsd_up;
470 467
471 error = nfsd_startup(nrservs); 468 error = nfsd_startup(nrservs, net);
472 if (error) 469 if (error)
473 goto out_destroy; 470 goto out_destroy;
474 error = svc_set_num_threads(nfsd_serv, NULL, nrservs); 471 error = svc_set_num_threads(nfsd_serv, NULL, nrservs);
@@ -481,7 +478,7 @@ nfsd_svc(int nrservs)
481 error = nfsd_serv->sv_nrthreads - 1; 478 error = nfsd_serv->sv_nrthreads - 1;
482out_shutdown: 479out_shutdown:
483 if (error < 0 && !nfsd_up_before) 480 if (error < 0 && !nfsd_up_before)
484 nfsd_shutdown(); 481 nfsd_shutdown(net);
485out_destroy: 482out_destroy:
486 nfsd_destroy(net); /* Release server */ 483 nfsd_destroy(net); /* Release server */
487out: 484out: