[pnfs] [PATCH 07/11] nfs41: rename the session expire state

andros at netapp.com andros at netapp.com
Fri Jul 11 10:39:14 EDT 2008


From: Andy Adamson <andros at netapp.com>

The session expire state used to include session destroy and session init.
With the session reset state, it now only performs session alloc.

Signed-off-by: Andy Adamson<andros at netapp.com>
---
 fs/nfs/nfs41_session_recovery.c        |    2 +-
 fs/nfs/nfs4proc.c                      |    8 ++++----
 include/linux/nfs41_session_recovery.h |   17 ++++++++---------
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/fs/nfs/nfs41_session_recovery.c b/fs/nfs/nfs41_session_recovery.c
index 493268d..f82f548 100644
--- a/fs/nfs/nfs41_session_recovery.c
+++ b/fs/nfs/nfs41_session_recovery.c
@@ -33,7 +33,7 @@ int nfs41_set_session_valid(struct nfs4_session *session)
 {
 	int ret;
 	smp_mb__before_clear_bit();
-	ret = test_and_clear_bit(NFS41_SESSION_EXPIRED,
+	ret = test_and_clear_bit(NFS41_SESSION_ALLOC,
 				&session->session_state);
 	smp_mb__after_clear_bit();
 
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 34ce4b5..fd59406 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -460,7 +460,7 @@ int nfs4_setup_sequence(struct nfs_client *clp,
 	if (clp->cl_minorversion == 0)
 		goto out;
 	BUG_ON(clp->cl_minorversion != 1);
-	if (nfs41_test_session_expired(session))
+	if (nfs41_test_session_alloc(session))
 		ret = nfs41_recover_session_sync(session);
 	if (!ret)
 		ret = nfs41_setup_sequence(session, args, res,
@@ -4409,7 +4409,7 @@ static int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
 	 * sessions that were associated with this clientid.
 	 */
 	list_for_each_entry(server, &clp->cl_superblocks, client_link)
-		nfs41_set_session_expired(server->session);
+		nfs41_set_session_alloc(server->session);
 
 	return _nfs4_proc_exchange_id(clp, cred);
 }
@@ -4617,7 +4617,7 @@ struct nfs4_session *nfs4_alloc_session(void)
 	if (!session)
 		return NULL;
 
-	nfs41_set_session_expired(session);
+	nfs41_set_session_alloc(session);
 
 	atomic_set(&session->ref_count, 1);
 
@@ -4845,7 +4845,7 @@ static int nfs4_proc_sequence(struct nfs_client *clp, struct rpc_cred *cred)
 	server = list_entry(clp->cl_superblocks.next, struct nfs_server,
 				client_link);
 
-	if (nfs41_test_session_expired(server->session))
+	if (nfs41_test_session_alloc(server->session))
 		return -NFS4ERR_STALE_CLIENTID;
 
 	/*
diff --git a/include/linux/nfs41_session_recovery.h b/include/linux/nfs41_session_recovery.h
index 4f2fdf8..892f402 100644
--- a/include/linux/nfs41_session_recovery.h
+++ b/include/linux/nfs41_session_recovery.h
@@ -18,29 +18,28 @@
  * Session state bits
  *
  * State machine.
- * NFS41_SESSION_EXPIRED bit set: session is alloc'ed and init, ready for
- * recovery
+ * NFS41_SESSION_ALLOC bit set: session is ready for create_session call.
  * NFS41_SESSION_RECOVER bit set: session is being reset/recovered
- * NFS41_SESSION_EXPIRED bit unset: valid session in use.
+ * NFS41_SESSION_ALLOC bit unset: valid session in use.
  * NFS41_SESSION_RESET bit set: session is being reset.
  */
 enum nfs41_session_state {
-	NFS41_SESSION_EXPIRED = 0,
+	NFS41_SESSION_ALLOC = 0,
 	NFS41_SESSION_RECOVER,
 	NFS41_SESSION_RESET,
 };
 
 /*
- * Set the session state expired
+ * Set the session state to alloc
  */
-static inline int nfs41_set_session_expired(struct nfs4_session *session)
+static inline int nfs41_set_session_alloc(struct nfs4_session *session)
 {
-	return test_and_set_bit(NFS41_SESSION_EXPIRED, &session->session_state);
+	return test_and_set_bit(NFS41_SESSION_ALLOC, &session->session_state);
 }
 
-static inline int nfs41_test_session_expired(struct nfs4_session *session)
+static inline int nfs41_test_session_alloc(struct nfs4_session *session)
 {
-	return test_bit(NFS41_SESSION_EXPIRED, &session->session_state);
+	return test_bit(NFS41_SESSION_ALLOC, &session->session_state);
 }
 
 /*
-- 
1.5.4.1



More information about the pNFS mailing list