[pnfs] [PATCH] Skip call to get_lease_time

Marc Eshel eshel at almaden.ibm.com
Mon Aug 27 13:41:07 EDT 2007


From: Marc Eshel <eshel at almaden.ibm.com>

If the create session is for a DS don't call get_lease_time which
uses PUTROOTFH and GETATTR.
---

 fs/nfs/nfs4proc.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e60c958..11ec63d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5697,6 +5697,7 @@ int nfs41_proc_setup_session(struct nfs4
 
         struct nfs_fsinfo fsinfo;
 	unsigned long now;
+	int save_flags = clp->cl_exchange_flags;
 	
 	now = jiffies;
 
@@ -5721,7 +5722,8 @@ int nfs41_proc_setup_session(struct nfs4
 		dprintk("unexpired session found!\n");
 		goto out;
 	}
-	dprintk("expired session found!\n");
+	dprintk("expired session found! exchange_flags %x\n",
+		clp->cl_exchange_flags);
 
 	clp->cl_session->mutating = 1;
 
@@ -5729,7 +5731,8 @@ int nfs41_proc_setup_session(struct nfs4
 	if ((status = nfs4_proc_exchange_id(clp)))
 		goto out_free;
 
-	dprintk("exchange_id succeeded!\n");
+	dprintk("exchange_id succeeded! exchange_flags %x\n",
+		clp->cl_exchange_flags);
 
 	if ((status = nfs4_proc_create_session(clp)))
 		goto out_free;
@@ -5739,7 +5742,7 @@ int nfs41_proc_setup_session(struct nfs4
 	clp->cl_session->expired = 0;
 	clp->cl_session->client = clp;
 
-	if (clp->cl_exchange_flags & EXCHGID4_FLAG_USE_PNFS_DS)
+	if (save_flags & EXCHGID4_FLAG_USE_PNFS_DS)
 		goto out;
 
 	status = nfs4_proc_get_lease_time(clp, &fsinfo);
@@ -5756,8 +5759,9 @@ int nfs41_proc_setup_session(struct nfs4
 
 	nfs4_schedule_state_renewal(clp);
 	
-	clp->cl_session->mutating = 0;
 out:
+	clp->cl_session->mutating = 0;
+
 	up(&clp->cl_session->session_sem);
 
 	return 0;


More information about the pNFS mailing list