[pnfs] [PATCH 06/29] nfs41: no lease update in nfs41_sequence_done for ds

Benny Halevy bhalevy at panasas.com
Fri Dec 28 03:44:30 EST 2007


From: Andy Adamson <andros at umich.edu>

Allow a NULL nfs_client parameter to nfs41_sequence_done.

The data server has no lease to update. There is no way to reference the
data server's struct nfs_client because we don't keep one.

The use of struct nfs_client for data server session creation will
will probably be replaced with a structure with only relevant fields.

Signed-off-by: Andy Adamson<andros at umich.edu>
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfs/nfs4proc.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index cd90bf8..9074bfa 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -252,6 +252,10 @@ int nfs4_wait_bit_interruptible(void *word)
 }
 
 #if defined(CONFIG_NFS_V4_1)
+/* For pNFS filelayout data servers:
+ * the nfs_client is NULL - to signal no lease update.
+ * session is the data server.
+ */
 static int nfs41_sequence_done(struct nfs_client *clp,
 	struct nfs4_session *session,
 	struct nfs41_sequence_res *res, int status)
@@ -260,8 +264,9 @@ static int nfs41_sequence_done(struct nfs_client *clp,
 	struct nfs4_slot_table *tbl;
 	struct nfs4_slot *slot;
 
+#if !defined(CONFIG_PNFS)
 	BUG_ON(clp == NULL);
-
+#endif /* !CONFIG_PNFS */
 	tbl = &session->fore_channel.slot_table;
 	slot = res->sr_slot;
 
@@ -284,6 +289,8 @@ static int nfs41_sequence_done(struct nfs_client *clp,
 		 * The sequence call was successful,
 		 * Update our lease renewal timers
 		 */
+			if (!clp)
+				goto no_update;
 		timestamp = res->sr_renewal_time;
 
 		spin_lock(&clp->cl_lock);
@@ -291,7 +298,7 @@ static int nfs41_sequence_done(struct nfs_client *clp,
 			clp->cl_last_renewal = timestamp;
 		spin_unlock(&clp->cl_lock);
 	}
-
+no_update:
 	/* Clear the 'busy' bit on the slot that was used */
 	smp_mb__before_clear_bit();
 	clear_bit(NFS4_SLOT_BUSY, &slot->flags);
-- 
1.5.3.3



More information about the pNFS mailing list