aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2011-05-22 12:47:46 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-05-29 13:52:33 -0400
commit707ed5fdb587c71fdb7ad224ba1d80231f33c974 (patch)
treea3903d971a59df7fb311fe9ce5cd830c92e2bd34
parentfb3296eb4636763918edef2d22e45b85b15d4518 (diff)
pnfs: align layoutget requests on page boundaries
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
-rw-r--r--fs/nfs/pnfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c2f09e9b670e..2357ee343f4a 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -850,6 +850,7 @@ pnfs_update_layout(struct inode *ino,
850 .offset = pos, 850 .offset = pos,
851 .length = count, 851 .length = count,
852 }; 852 };
853 unsigned pg_offset;
853 struct nfs_inode *nfsi = NFS_I(ino); 854 struct nfs_inode *nfsi = NFS_I(ino);
854 struct nfs_client *clp = NFS_SERVER(ino)->nfs_client; 855 struct nfs_client *clp = NFS_SERVER(ino)->nfs_client;
855 struct pnfs_layout_hdr *lo; 856 struct pnfs_layout_hdr *lo;
@@ -899,6 +900,13 @@ pnfs_update_layout(struct inode *ino,
899 spin_unlock(&clp->cl_lock); 900 spin_unlock(&clp->cl_lock);
900 } 901 }
901 902
903 pg_offset = arg.offset & ~PAGE_CACHE_MASK;
904 if (pg_offset) {
905 arg.offset -= pg_offset;
906 arg.length += pg_offset;
907 }
908 arg.length = PAGE_CACHE_ALIGN(arg.length);
909
902 lseg = send_layoutget(lo, ctx, &arg, gfp_flags); 910 lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
903 if (!lseg && first) { 911 if (!lseg && first) {
904 spin_lock(&clp->cl_lock); 912 spin_lock(&clp->cl_lock);