aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 19:55:31 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:38 -0400
commit1825a0d08f22463e5a8f4b1636473efd057a3479 (patch)
treeb010b2bbb71431802cb1714483b69060ce09ff39 /fs/nfs/nfs4filelayout.c
parent9533da2979757258d3fd5429d830a297013d69ed (diff)
NFS: prepare coalesce testing for directio
The coalesce code made assumptions that will no longer be true once non-page aligned io occurs. This introduces no change in current behavior, but allows for more general situations to come. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 02d8170ce0f3..e40523f2fe26 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -796,6 +796,16 @@ filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
796{ 796{
797 BUG_ON(pgio->pg_lseg != NULL); 797 BUG_ON(pgio->pg_lseg != NULL);
798 798
799 if (req->wb_offset != req->wb_pgbase) {
800 /*
801 * Handling unaligned pages is difficult, because have to
802 * somehow split a req in two in certain cases in the
803 * pg.test code. Avoid this by just not using pnfs
804 * in this case.
805 */
806 nfs_pageio_reset_read_mds(pgio);
807 return;
808 }
799 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, 809 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
800 req->wb_context, 810 req->wb_context,
801 0, 811 0,
@@ -815,6 +825,8 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
815 825
816 BUG_ON(pgio->pg_lseg != NULL); 826 BUG_ON(pgio->pg_lseg != NULL);
817 827
828 if (req->wb_offset != req->wb_pgbase)
829 goto out_mds;
818 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, 830 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
819 req->wb_context, 831 req->wb_context,
820 0, 832 0,