aboutsummaryrefslogtreecommitdiff
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-11-26 15:22:08 +0300
committerJ. Bruce Fields <bfields@redhat.com>2012-11-28 10:13:51 -0500
commit4dce0ac9069bbebfd34f890f599ccdb92fa76e9f (patch)
treee1c59be92c91fe7ce58e225281fb06f007b59420 /fs/nfsd/nfs4state.c
parent4e37a7c2075baa2a15a2ab90fcc44173888016ed (diff)
nfsd: cleanup NFSd state shutdown a bit
This patch renames __nfs4_state_shutdown_net() into nfs4_state_shutdown_net(), __nfs4_state_shutdown() into nfs4_state_shutdown_net() and moves all network related shutdown operations to nfs4_state_shutdown_net(). Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index bc2fc9f076f..84a27a24b80 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4829,7 +4829,7 @@ err:
}
static void
-__nfs4_state_shutdown_net(struct net *net)
+nfs4_state_destroy_net(struct net *net)
{
int i;
struct nfs4_client *clp = NULL;
@@ -4857,6 +4857,7 @@ __nfs4_state_shutdown_net(struct net *net)
kfree(nn->ownerstr_hashtbl);
kfree(nn->unconf_id_hashtbl);
kfree(nn->conf_id_hashtbl);
+ put_net(net);
}
/* initialization to perform when the nfsd service is started: */
@@ -4906,19 +4907,20 @@ out_free_laundry:
destroy_workqueue(laundry_wq);
out_recovery:
nfsd4_client_tracking_exit(net);
- __nfs4_state_shutdown_net(net);
- put_net(net);
+ nfs4_state_destroy_net(net);
return ret;
}
/* should be called with the state lock held */
static void
-__nfs4_state_shutdown(struct net *net)
+nfs4_state_shutdown_net(struct net *net)
{
struct nfs4_delegation *dp = NULL;
struct list_head *pos, *next, reaplist;
+ struct nfsd_net *nn = net_generic(net, nfsd_net_id);
- __nfs4_state_shutdown_net(net);
+ cancel_delayed_work_sync(&nn->laundromat_work);
+ locks_end_grace(&nn->nfsd4_manager);
INIT_LIST_HEAD(&reaplist);
spin_lock(&recall_lock);
@@ -4935,19 +4937,16 @@ __nfs4_state_shutdown(struct net *net)
}
nfsd4_client_tracking_exit(net);
- put_net(net);
+ nfs4_state_destroy_net(net);
}
void
nfs4_state_shutdown(void)
{
struct net *net = &init_net;
- struct nfsd_net *nn = net_generic(net, nfsd_net_id);
- cancel_delayed_work_sync(&nn->laundromat_work);
+ nfs4_state_shutdown_net(net);
destroy_workqueue(laundry_wq);
- locks_end_grace(&nn->nfsd4_manager);
- __nfs4_state_shutdown(net);
nfsd4_destroy_callback_queue();
}