Commit 707ed5fd authored by Benny Halevy's avatar Benny Halevy Committed by Boaz Harrosh

pnfs: align layoutget requests on page boundaries

Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
parent fb3296eb
......@@ -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;
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment