From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, Trond.Myklebust@netapp.com,
linux-kernel@vger.kernel.org, devel@openvz.org
Subject: [PATCH 3/5] nfsd: cleanup NFSd state shutdown a bit
Date: Mon, 26 Nov 2012 15:22:08 +0300 [thread overview]
Message-ID: <20121126122208.955.49674.stgit@localhost.localdomain> (raw)
In-Reply-To: <20121126121907.955.25349.stgit@localhost.localdomain>
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>
---
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 149f7b1..edff2cc 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4825,7 +4825,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;
@@ -4853,6 +4853,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: */
@@ -4902,19 +4903,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);
@@ -4931,19 +4933,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();
}
next prev parent reply other threads:[~2012-11-26 12:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 12:21 [PATCH 0/5] nfsd: more NFSv4 state containerization Stanislav Kinsbursky
2012-11-26 12:21 ` [PATCH 1/5] nfsd: make client_lock per net Stanislav Kinsbursky
2012-11-26 12:22 ` [PATCH 2/5] nfsd: make delegations shutdown network namespace aware Stanislav Kinsbursky
2012-11-26 12:22 ` Stanislav Kinsbursky [this message]
2012-11-26 12:22 ` [PATCH 4/5] nfsd: cleanup NFSd state start a bit Stanislav Kinsbursky
2012-11-26 12:22 ` [PATCH 5/5] nfsd: call state init and shutdown twice Stanislav Kinsbursky
2012-11-27 22:29 ` [PATCH 0/5] nfsd: more NFSv4 state containerization J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121126122208.955.49674.stgit@localhost.localdomain \
--to=skinsbursky@parallels.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).