public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 08/15] NFSv41: Don't store session state in the nfs_client->cl_state
Date: Mon, 14 Jun 2010 17:51:32 -0400	[thread overview]
Message-ID: <1276552299-6625-8-git-send-email-Trond.Myklebust@netapp.com> (raw)
In-Reply-To: <1276552299-6625-7-git-send-email-Trond.Myklebust@netapp.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/nfs4_fs.h   |    5 ++++-
 fs/nfs/nfs4proc.c  |    4 ++--
 fs/nfs/nfs4state.c |    6 ++++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 9c0aa81..bb1e955 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -45,10 +45,13 @@ enum nfs4_client_state {
 	NFS4CLNT_RECLAIM_NOGRACE,
 	NFS4CLNT_DELEGRETURN,
 	NFS4CLNT_SESSION_RESET,
-	NFS4CLNT_SESSION_DRAINING,
 	NFS4CLNT_RECALL_SLOT,
 };
 
+enum nfs4_session_state {
+	NFS4_SESSION_DRAINING,
+};
+
 /*
  * struct rpc_sequence ensures that RPC calls are sent in the exact
  * order that they appear on the list.
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 60ea066..7e0483c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -356,7 +356,7 @@ static void nfs41_check_drain_session_complete(struct nfs4_session *ses)
 {
 	struct rpc_task *task;
 
-	if (!test_bit(NFS4CLNT_SESSION_DRAINING, &ses->clp->cl_state)) {
+	if (!test_bit(NFS4_SESSION_DRAINING, &ses->session_state)) {
 		task = rpc_wake_up_next(&ses->fc_slot_table.slot_tbl_waitq);
 		if (task)
 			rpc_task_set_priority(task, RPC_PRIORITY_PRIVILEGED);
@@ -489,7 +489,7 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
 	tbl = &session->fc_slot_table;
 
 	spin_lock(&tbl->slot_tbl_lock);
-	if (test_bit(NFS4CLNT_SESSION_DRAINING, &session->clp->cl_state) &&
+	if (test_bit(NFS4_SESSION_DRAINING, &session->session_state) &&
 	    !rpc_task_has_priority(task, RPC_PRIORITY_PRIVILEGED)) {
 		/*
 		 * The state manager will wait until the slot table is empty.
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 34acf59..4538c56 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -145,7 +145,9 @@ static void nfs4_end_drain_session(struct nfs_client *clp)
 	struct nfs4_session *ses = clp->cl_session;
 	int max_slots;
 
-	if (test_and_clear_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) {
+	if (ses == NULL)
+		return;
+	if (test_and_clear_bit(NFS4_SESSION_DRAINING, &ses->session_state)) {
 		spin_lock(&ses->fc_slot_table.slot_tbl_lock);
 		max_slots = ses->fc_slot_table.max_slots;
 		while (max_slots--) {
@@ -167,7 +169,7 @@ static int nfs4_begin_drain_session(struct nfs_client *clp)
 	struct nfs4_slot_table *tbl = &ses->fc_slot_table;
 
 	spin_lock(&tbl->slot_tbl_lock);
-	set_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state);
+	set_bit(NFS4_SESSION_DRAINING, &ses->session_state);
 	if (tbl->highest_used_slotid != -1) {
 		INIT_COMPLETION(ses->complete);
 		spin_unlock(&tbl->slot_tbl_lock);
-- 
1.7.0.1


  reply	other threads:[~2010-06-14 21:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 21:51 [PATCH 01/15] NFSv41: Fix a memory leak in nfs41_proc_async_sequence() Trond Myklebust
2010-06-14 21:51 ` [PATCH 02/15] NFSv4.1: Clean up nfs4_setup_sequence Trond Myklebust
2010-06-14 21:51   ` [PATCH 03/15] NFSv4.1: Simplify nfs41_sequence_done() Trond Myklebust
2010-06-14 21:51     ` [PATCH 04/15] NFSv4: Kill nfs4_async_handle_error() abuses by NFSv4.1 Trond Myklebust
2010-06-14 21:51       ` [PATCH 05/15] NFSv4.1: Merge the nfs41_proc_async_sequence() and nfs4_proc_sequence() Trond Myklebust
2010-06-14 21:51         ` [PATCH 06/15] NFSv4.1: Make nfs4_setup_sequence take a nfs_server argument Trond Myklebust
2010-06-14 21:51           ` [PATCH 07/15] NFSv41: Further cleanup for nfs4_sequence_done Trond Myklebust
2010-06-14 21:51             ` Trond Myklebust [this message]
2010-06-14 21:51               ` [PATCH 09/15] NFSv41: Clean up the NFSv4.1 minor version specific operations Trond Myklebust
2010-06-14 21:51                 ` [PATCH 10/15] NFSv41: Convert the various reboot recovery ops etc to minor version ops Trond Myklebust
2010-06-14 21:51                   ` [PATCH 11/15] NFSv41: Fix nfs_async_inode_return_delegation() ugliness Trond Myklebust
2010-06-14 21:51                     ` [PATCH 12/15] NFSv41: Deprecate nfs_client->cl_minorversion Trond Myklebust
2010-06-14 21:51                       ` [PATCH 13/15] NFSv41: Clean up exclusive create Trond Myklebust
2010-06-14 21:51                         ` [PATCH 14/15] NFSv41: Cleanup for nfs4_alloc_session Trond Myklebust
2010-06-14 21:51                           ` [PATCH 15/15] NFSv4.1: There is no need to init the session more than once Trond Myklebust
2010-06-14 23:13                         ` [PATCH 13/15] NFSv41: Clean up exclusive create Benny Halevy
2010-06-15 15:50                           ` Trond Myklebust
     [not found]                             ` <1276617009.8767.6.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-06-15 16:08                               ` Benny Halevy
2010-06-15 16:19                                 ` Trond Myklebust
     [not found]                                   ` <1276618750.8767.7.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-06-15 16:30                                     ` Benny Halevy
2010-06-15 16:50   ` [PATCH 02/15] NFSv4.1: Clean up nfs4_setup_sequence Gilliam, PaulX J
     [not found]     ` <0A97A441BFADC74EA1E299A79C69DF9213D49EB687-osO9UTpF0UQ64kNsxIetb7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-06-15 17:32       ` Trond Myklebust
2010-06-15 17:53         ` J. Bruce Fields
     [not found]         ` <1276623141.8767.47.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-06-15 18:01           ` Gilliam, PaulX J

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=1276552299-6625-8-git-send-email-Trond.Myklebust@netapp.com \
    --to=trond.myklebust@netapp.com \
    --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