Skip to content

Commit

Permalink
pnfs: align layoutget requests on page boundaries
Browse files Browse the repository at this point in the history
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
  • Loading branch information
Benny Halevy authored and Boaz Harrosh committed May 29, 2011
1 parent fb3296e commit 707ed5f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ pnfs_update_layout(struct inode *ino,
.offset = pos,
.length = count,
};
unsigned pg_offset;
struct nfs_inode *nfsi = NFS_I(ino);
struct nfs_client *clp = NFS_SERVER(ino)->nfs_client;
struct pnfs_layout_hdr *lo;
Expand Down Expand Up @@ -899,6 +900,13 @@ pnfs_update_layout(struct inode *ino,
spin_unlock(&clp->cl_lock);
}

pg_offset = arg.offset & ~PAGE_CACHE_MASK;
if (pg_offset) {
arg.offset -= pg_offset;
arg.length += pg_offset;
}
arg.length = PAGE_CACHE_ALIGN(arg.length);

lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
if (!lseg && first) {
spin_lock(&clp->cl_lock);
Expand Down

0 comments on commit 707ed5f

Please sign in to comment.