Commit db42d1a76a8dfcaba7a2dc9c591fa4e231db22b3
Committed by
J. Bruce Fields
1 parent
db6e182c17
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 6 additions and 9 deletions Side-by-side Diff
fs/nfsd/nfssvc.c
... | ... | @@ -203,10 +203,9 @@ |
203 | 203 | |
204 | 204 | static bool nfsd_up = false; |
205 | 205 | |
206 | -static int nfsd_startup(int nrservs) | |
206 | +static int nfsd_startup(int nrservs, struct net *net) | |
207 | 207 | { |
208 | 208 | int ret; |
209 | - struct net *net = &init_net; | |
210 | 209 | |
211 | 210 | if (nfsd_up) |
212 | 211 | return 0; |
213 | 212 | |
214 | 213 | |
... | ... | @@ -237,16 +236,14 @@ |
237 | 236 | out_net_state: |
238 | 237 | nfs4_state_shutdown(); |
239 | 238 | out_lockd: |
240 | - lockd_down(&init_net); | |
239 | + lockd_down(net); | |
241 | 240 | out_racache: |
242 | 241 | nfsd_racache_shutdown(); |
243 | 242 | return ret; |
244 | 243 | } |
245 | 244 | |
246 | -static void nfsd_shutdown(void) | |
245 | +static void nfsd_shutdown(struct net *net) | |
247 | 246 | { |
248 | - struct net *net = &init_net; | |
249 | - | |
250 | 247 | /* |
251 | 248 | * write_ports can create the server without actually starting |
252 | 249 | * any threads--if we get shut down before any threads are |
... | ... | @@ -264,7 +261,7 @@ |
264 | 261 | |
265 | 262 | static void nfsd_last_thread(struct svc_serv *serv, struct net *net) |
266 | 263 | { |
267 | - nfsd_shutdown(); | |
264 | + nfsd_shutdown(net); | |
268 | 265 | |
269 | 266 | svc_rpcb_cleanup(serv, net); |
270 | 267 | |
... | ... | @@ -468,7 +465,7 @@ |
468 | 465 | |
469 | 466 | nfsd_up_before = nfsd_up; |
470 | 467 | |
471 | - error = nfsd_startup(nrservs); | |
468 | + error = nfsd_startup(nrservs, net); | |
472 | 469 | if (error) |
473 | 470 | goto out_destroy; |
474 | 471 | error = svc_set_num_threads(nfsd_serv, NULL, nrservs); |
... | ... | @@ -481,7 +478,7 @@ |
481 | 478 | error = nfsd_serv->sv_nrthreads - 1; |
482 | 479 | out_shutdown: |
483 | 480 | if (error < 0 && !nfsd_up_before) |
484 | - nfsd_shutdown(); | |
481 | + nfsd_shutdown(net); | |
485 | 482 | out_destroy: |
486 | 483 | nfsd_destroy(net); /* Release server */ |
487 | 484 | out: |