summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_aops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-07-11 22:25:56 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-11 22:25:56 -0700
commit8b2e77c1634935aefc9a4e2aacadda9cd30b78d7 (patch)
treeb051341e99d8593e85b73664d71d8aaf1e9a7962 /fs/xfs/xfs_aops.c
parentc2efdfc100af42cc04525ef0db74b176da59e1a4 (diff)
downloadblackbird-obmc-linux-8b2e77c1634935aefc9a4e2aacadda9cd30b78d7.tar.gz
blackbird-obmc-linux-8b2e77c1634935aefc9a4e2aacadda9cd30b78d7.zip
xfs: use iomap for blocksize == PAGE_SIZE readpage and readpages
For file systems with a block size that equals the page size we never do partial reads, so we can use the buffer_head-less iomap versions of readpage and readpages without conflicting with the buffer_head structures create later in write_begin. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_aops.c')
-rw-r--r--fs/xfs/xfs_aops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 8eb3ba3d4d00..85e1a625d42a 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -1401,6 +1401,8 @@ xfs_vm_readpage(
struct page *page)
{
trace_xfs_vm_readpage(page->mapping->host, 1);
+ if (i_blocksize(page->mapping->host) == PAGE_SIZE)
+ return iomap_readpage(page, &xfs_iomap_ops);
return mpage_readpage(page, xfs_get_blocks);
}
@@ -1412,6 +1414,8 @@ xfs_vm_readpages(
unsigned nr_pages)
{
trace_xfs_vm_readpages(mapping->host, nr_pages);
+ if (i_blocksize(mapping->host) == PAGE_SIZE)
+ return iomap_readpages(mapping, pages, nr_pages, &xfs_iomap_ops);
return mpage_readpages(mapping, pages, nr_pages, xfs_get_blocks);
}
OpenPOWER on IntegriCloud