aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfssvc.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-11-26 07:22:18 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-11-28 10:13:53 -0500
commitf252bc6806a9428f2e3a429e4cdffbd012de9839 (patch)
treeb2beb8aa4ccd300f5b3ed70431d167b46fbcd9e4 /fs/nfsd/nfssvc.c
parentd85ed443052570b25ea4b5f5fa70c57e0129fbc4 (diff)
nfsd: call state init and shutdown twice
Split NFSv4 state init and shutdown into two different calls: per-net one and generic one. Per-net cwinit/shutdown pair have to be called for any namespace, generic pair - only once on NSFd kthreads start and shutdown respectively. Refresh of diff-nfsd-call-state-init-twice Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r--fs/nfsd/nfssvc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 30d3784d0280..b34a67d8ec44 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -207,6 +207,7 @@ static bool nfsd_up = false;
207static int nfsd_startup(int nrservs) 207static int nfsd_startup(int nrservs)
208{ 208{
209 int ret; 209 int ret;
210 struct net *net = &init_net;
210 211
211 if (nfsd_up) 212 if (nfsd_up)
212 return 0; 213 return 0;
@@ -221,14 +222,21 @@ static int nfsd_startup(int nrservs)
221 ret = nfsd_init_socks(); 222 ret = nfsd_init_socks();
222 if (ret) 223 if (ret)
223 goto out_racache; 224 goto out_racache;
224 ret = lockd_up(&init_net); 225 ret = lockd_up(net);
225 if (ret) 226 if (ret)
226 goto out_racache; 227 goto out_racache;
227 ret = nfs4_state_start(); 228 ret = nfs4_state_start();
228 if (ret) 229 if (ret)
229 goto out_lockd; 230 goto out_lockd;
231
232 ret = nfs4_state_start_net(net);
233 if (ret)
234 goto out_net_state;
235
230 nfsd_up = true; 236 nfsd_up = true;
231 return 0; 237 return 0;
238out_net_state:
239 nfs4_state_shutdown();
232out_lockd: 240out_lockd:
233 lockd_down(&init_net); 241 lockd_down(&init_net);
234out_racache: 242out_racache:
@@ -238,6 +246,8 @@ out_racache:
238 246
239static void nfsd_shutdown(void) 247static void nfsd_shutdown(void)
240{ 248{
249 struct net *net = &init_net;
250
241 /* 251 /*
242 * write_ports can create the server without actually starting 252 * write_ports can create the server without actually starting
243 * any threads--if we get shut down before any threads are 253 * any threads--if we get shut down before any threads are
@@ -246,8 +256,9 @@ static void nfsd_shutdown(void)
246 */ 256 */
247 if (!nfsd_up) 257 if (!nfsd_up)
248 return; 258 return;
259 nfs4_state_shutdown_net(net);
249 nfs4_state_shutdown(); 260 nfs4_state_shutdown();
250 lockd_down(&init_net); 261 lockd_down(net);
251 nfsd_racache_shutdown(); 262 nfsd_racache_shutdown();
252 nfsd_up = false; 263 nfsd_up = false;
253} 264}