[pnfs] [PATCH 3/8] pnfs: change pnfs_update_layout parameter name

andros at umich.edu andros at umich.edu
Mon Mar 10 14:39:15 EDT 2008


From: Andy Adamson <andros at umich.edu>

Change layout_new to lo as it is only sometimes new!

Signed-off-by: Andy Adamson<andros at umich.edu>
---
 fs/nfs/pnfs.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 757e917..31158b6 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -828,13 +828,13 @@ pnfs_update_layout(struct inode *ino,
 	};
 	struct nfs_inode *nfsi = NFS_I(ino);
 	struct nfs_server *nfss = NFS_SERVER(ino);
-	struct pnfs_layout_type *layout_new;
+	struct pnfs_layout_type *lo;
 	struct pnfs_layout_segment *lseg = NULL;
 	int result = -EIO;
 
-	layout_new = get_lock_alloc_layout(ino, nfss->pnfs_curr_ld->ld_io_ops);
-	if (IS_ERR(layout_new)) {
-		result = PTR_ERR(layout_new);
+	lo = get_lock_alloc_layout(ino, nfss->pnfs_curr_ld->ld_io_ops);
+	if (IS_ERR(lo)) {
+		result = PTR_ERR(lo);
 		goto ret;
 	}
 
@@ -842,7 +842,7 @@ pnfs_update_layout(struct inode *ino,
 	arg.lseg.offset = pos;
 	arg.lseg.length = count;
 	/* Check to see if the layout for the given range already exists */
-	lseg = pnfs_has_layout(layout_new, &arg.lseg, lsegpp != NULL);
+	lseg = pnfs_has_layout(lo, &arg.lseg, lsegpp != NULL);
 	if (lseg) {
 		dprintk("%s: Using cached layout %p for %llu@%llu iomode %d)\n",
 			__FUNCTION__,
@@ -869,17 +869,17 @@ pnfs_update_layout(struct inode *ino,
 	}
 
 	res.layout.buf = NULL;
-	memcpy(&layout_new->stateid.data, &arg.stateid.data, NFS4_STATEID_SIZE);
+	memcpy(&lo->stateid.data, &arg.stateid.data, NFS4_STATEID_SIZE);
 	spin_unlock(&nfsi->lo_lock);
 	result = get_layout(ino, ctx, &gdata);
 	spin_lock(&nfsi->lo_lock);
 	/* FIXME: check for reordering using the returned sequence id */
-	memcpy(&res.stateid.data, &layout_new->stateid.data, NFS4_STATEID_SIZE);
+	memcpy(&res.stateid.data, &lo->stateid.data, NFS4_STATEID_SIZE);
 
 	/* we got a reference on nfsi->current_layout hence it must never
 	 * change, even while nfsi->lo_lock was not held.
 	 */
-	BUG_ON(nfsi->current_layout != layout_new);
+	BUG_ON(nfsi->current_layout != lo);
 
 	if (result) {
 		dprintk("%s: ERROR retrieving layout %d\n",
@@ -918,7 +918,7 @@ pnfs_update_layout(struct inode *ino,
 	}
 
 	/* Inject layout blob into I/O device driver */
-	lseg = pnfs_inject_layout(layout_new, &res, lsegpp != NULL);
+	lseg = pnfs_inject_layout(lo, &res, lsegpp != NULL);
 	if (IS_ERR(lseg)) {
 		result =  PTR_ERR(lseg);
 		lseg = NULL;
@@ -928,9 +928,9 @@ pnfs_update_layout(struct inode *ino,
 	}
 
 	if (res.return_on_close) {
-		layout_new->roc_iomode |= res.lseg.iomode;
-		if (!layout_new->roc_iomode)
-			layout_new->roc_iomode = IOMODE_ANY;
+		lo->roc_iomode |= res.lseg.iomode;
+		if (!lo->roc_iomode)
+			lo->roc_iomode = IOMODE_ANY;
 	}
 
 	result = 0;
@@ -942,7 +942,7 @@ get_out:
 	/* res.layout.buf kalloc'ed by the xdr decoder? */
 	kfree(res.layout.buf);
 out:
-	put_unlock_current_layout(nfsi, layout_new);
+	put_unlock_current_layout(nfsi, lo);
 ret:
 	dprintk("%s end (err:%d) state 0x%lx lseg %p\n",
 		__FUNCTION__, result, nfsi->pnfs_layout_state, lseg);
-- 
1.5.0.2



More information about the pNFS mailing list