diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-11-26 07:22:08 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-11-28 10:13:51 -0500 |
commit | 4dce0ac9069bbebfd34f890f599ccdb92fa76e9f (patch) | |
tree | e1c59be92c91fe7ce58e225281fb06f007b59420 /fs | |
parent | 4e37a7c2075baa2a15a2ab90fcc44173888016ed (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')
-rw-r--r-- | fs/nfsd/nfs4state.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index bc2fc9f076fc..84a27a24b806 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4829,7 +4829,7 @@ err: | |||
4829 | } | 4829 | } |
4830 | 4830 | ||
4831 | static void | 4831 | static void |
4832 | __nfs4_state_shutdown_net(struct net *net) | 4832 | nfs4_state_destroy_net(struct net *net) |
4833 | { | 4833 | { |
4834 | int i; | 4834 | int i; |
4835 | struct nfs4_client *clp = NULL; | 4835 | struct nfs4_client *clp = NULL; |
@@ -4857,6 +4857,7 @@ __nfs4_state_shutdown_net(struct net *net) | |||
4857 | kfree(nn->ownerstr_hashtbl); | 4857 | kfree(nn->ownerstr_hashtbl); |
4858 | kfree(nn->unconf_id_hashtbl); | 4858 | kfree(nn->unconf_id_hashtbl); |
4859 | kfree(nn->conf_id_hashtbl); | 4859 | kfree(nn->conf_id_hashtbl); |
4860 | put_net(net); | ||
4860 | } | 4861 | } |
4861 | 4862 | ||
4862 | /* initialization to perform when the nfsd service is started: */ | 4863 | /* initialization to perform when the nfsd service is started: */ |
@@ -4906,19 +4907,20 @@ out_free_laundry: | |||
4906 | destroy_workqueue(laundry_wq); | 4907 | destroy_workqueue(laundry_wq); |
4907 | out_recovery: | 4908 | out_recovery: |
4908 | nfsd4_client_tracking_exit(net); | 4909 | nfsd4_client_tracking_exit(net); |
4909 | __nfs4_state_shutdown_net(net); | 4910 | nfs4_state_destroy_net(net); |
4910 | put_net(net); | ||
4911 | return ret; | 4911 | return ret; |
4912 | } | 4912 | } |
4913 | 4913 | ||
4914 | /* should be called with the state lock held */ | 4914 | /* should be called with the state lock held */ |
4915 | static void | 4915 | static void |
4916 | __nfs4_state_shutdown(struct net *net) | 4916 | nfs4_state_shutdown_net(struct net *net) |
4917 | { | 4917 | { |
4918 | struct nfs4_delegation *dp = NULL; | 4918 | struct nfs4_delegation *dp = NULL; |
4919 | struct list_head *pos, *next, reaplist; | 4919 | struct list_head *pos, *next, reaplist; |
4920 | struct nfsd_net *nn = net_generic(net, nfsd_net_id); | ||
4920 | 4921 | ||
4921 | __nfs4_state_shutdown_net(net); | 4922 | cancel_delayed_work_sync(&nn->laundromat_work); |
4923 | locks_end_grace(&nn->nfsd4_manager); | ||
4922 | 4924 | ||
4923 | INIT_LIST_HEAD(&reaplist); | 4925 | INIT_LIST_HEAD(&reaplist); |
4924 | spin_lock(&recall_lock); | 4926 | spin_lock(&recall_lock); |
@@ -4935,19 +4937,16 @@ __nfs4_state_shutdown(struct net *net) | |||
4935 | } | 4937 | } |
4936 | 4938 | ||
4937 | nfsd4_client_tracking_exit(net); | 4939 | nfsd4_client_tracking_exit(net); |
4938 | put_net(net); | 4940 | nfs4_state_destroy_net(net); |
4939 | } | 4941 | } |
4940 | 4942 | ||
4941 | void | 4943 | void |
4942 | nfs4_state_shutdown(void) | 4944 | nfs4_state_shutdown(void) |
4943 | { | 4945 | { |
4944 | struct net *net = &init_net; | 4946 | struct net *net = &init_net; |
4945 | struct nfsd_net *nn = net_generic(net, nfsd_net_id); | ||
4946 | 4947 | ||
4947 | cancel_delayed_work_sync(&nn->laundromat_work); | 4948 | nfs4_state_shutdown_net(net); |
4948 | destroy_workqueue(laundry_wq); | 4949 | destroy_workqueue(laundry_wq); |
4949 | locks_end_grace(&nn->nfsd4_manager); | ||
4950 | __nfs4_state_shutdown(net); | ||
4951 | nfsd4_destroy_callback_queue(); | 4950 | nfsd4_destroy_callback_queue(); |
4952 | } | 4951 | } |
4953 | 4952 | ||