summaryrefslogtreecommitdiff
path: root/fs/nfsd/nfssvc.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-11-26 16:22:18 +0400
committerJ. Bruce Fields <bfields@redhat.com>2012-11-28 19:13:53 +0400
commitf252bc6806a9428f2e3a429e4cdffbd012de9839 (patch)
treeb2beb8aa4ccd300f5b3ed70431d167b46fbcd9e4 /fs/nfsd/nfssvc.c
parentd85ed443052570b25ea4b5f5fa70c57e0129fbc4 (diff)
downloadlinux-f252bc6806a9428f2e3a429e4cdffbd012de9839.tar.xz
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;
static int nfsd_startup(int nrservs)
{
int ret;
+ struct net *net = &init_net;
if (nfsd_up)
return 0;
@@ -221,14 +222,21 @@ static int nfsd_startup(int nrservs)
ret = nfsd_init_socks();
if (ret)
goto out_racache;
- ret = lockd_up(&init_net);
+ ret = lockd_up(net);
if (ret)
goto out_racache;
ret = nfs4_state_start();
if (ret)
goto out_lockd;
+
+ ret = nfs4_state_start_net(net);
+ if (ret)
+ goto out_net_state;
+
nfsd_up = true;
return 0;
+out_net_state:
+ nfs4_state_shutdown();
out_lockd:
lockd_down(&init_net);
out_racache:
@@ -238,6 +246,8 @@ out_racache:
static void nfsd_shutdown(void)
{
+ struct net *net = &init_net;
+
/*
* write_ports can create the server without actually starting
* any threads--if we get shut down before any threads are
@@ -246,8 +256,9 @@ static void nfsd_shutdown(void)
*/
if (!nfsd_up)
return;
+ nfs4_state_shutdown_net(net);
nfs4_state_shutdown();
- lockd_down(&init_net);
+ lockd_down(net);
nfsd_racache_shutdown();
nfsd_up = false;
}