[pnfs] [PATCH 33/37] pnfs: client layout cache: update_layout: look for lseg using pnfs_has_layout
Benny Halevy
bhalevy at panasas.com
Tue Jan 1 05:52:01 EST 2008
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
fs/nfs/pnfs.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c9851bb..bd901a8 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -780,14 +780,8 @@ 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 */
- if (nfsi->current_layout != NULL &&
- (!nfss->pnfs_curr_ld->ld_io_ops->has_layout ||
- nfss->pnfs_curr_ld->ld_io_ops->has_layout(
- nfsi->current_layout, ino, &arg.lseg))) {
- /* TODO: To make this generic, I would need to compare the extents
- * of the existing layout information.
- * For now, assume that whole file layouts are always returned.
- */
+ lseg = pnfs_has_layout(layout_new, &arg.lseg, lsegpp != NULL);
+ if (lseg) {
dprintk("%s: Using cached layout %p for %llu@%llu iomode %d)\n",
__FUNCTION__,
nfsi->current_layout,
@@ -795,7 +789,8 @@ pnfs_update_layout(struct inode *ino,
arg.lseg.offset,
arg.lseg.iomode);
- return 0; /* Already have layout information */
+ result = 0;
+ goto out;
}
/* if get layout already failed once goto out */
--
1.5.3.3
More information about the pNFS
mailing list