aboutsummaryrefslogtreecommitdiff
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-11-26 15:22:18 +0300
committerJ. Bruce Fields <bfields@redhat.com>2012-11-28 10:13:53 -0500
commitf252bc6806a9428f2e3a429e4cdffbd012de9839 (patch)
treeb2beb8aa4ccd300f5b3ed70431d167b46fbcd9e4 /fs/nfsd/nfs4state.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/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 6f5798623eb..fb98f291aac 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4861,12 +4861,22 @@ nfs4_state_destroy_net(struct net *net)
put_net(net);
}
-static int
+int
nfs4_state_start_net(struct net *net)
{
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
int ret;
+ /*
+ * FIXME: For now, we hang most of the pernet global stuff off of
+ * init_net until nfsd is fully containerized. Eventually, we'll
+ * need to pass a net pointer into this function, take a reference
+ * to that instead and then do most of the rest of this on a per-net
+ * basis.
+ */
+ if (net != &init_net)
+ return -EINVAL;
+
ret = nfs4_state_create_net(net);
if (ret)
return ret;
@@ -4901,21 +4911,8 @@ nfs4_state_start(void)
set_max_delegations();
- /*
- * FIXME: For now, we hang most of the pernet global stuff off of
- * init_net until nfsd is fully containerized. Eventually, we'll
- * need to pass a net pointer into this function, take a reference
- * to that instead and then do most of the rest of this on a per-net
- * basis.
- */
- ret = nfs4_state_start_net(&init_net);
- if (ret)
- goto out_free_callback;
-
return 0;
-out_free_callback:
- nfsd4_destroy_callback_queue();
out_free_laundry:
destroy_workqueue(laundry_wq);
out_recovery:
@@ -4923,7 +4920,7 @@ out_recovery:
}
/* should be called with the state lock held */
-static void
+void
nfs4_state_shutdown_net(struct net *net)
{
struct nfs4_delegation *dp = NULL;
@@ -4954,9 +4951,6 @@ nfs4_state_shutdown_net(struct net *net)
void
nfs4_state_shutdown(void)
{
- struct net *net = &init_net;
-
- nfs4_state_shutdown_net(net);
destroy_workqueue(laundry_wq);
nfsd4_destroy_callback_queue();
}