Commit 8b2e77c1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent c2efdfc1
...@@ -1401,6 +1401,8 @@ xfs_vm_readpage( ...@@ -1401,6 +1401,8 @@ xfs_vm_readpage(
struct page *page) struct page *page)
{ {
trace_xfs_vm_readpage(page->mapping->host, 1); 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); return mpage_readpage(page, xfs_get_blocks);
} }
...@@ -1412,6 +1414,8 @@ xfs_vm_readpages( ...@@ -1412,6 +1414,8 @@ xfs_vm_readpages(
unsigned nr_pages) unsigned nr_pages)
{ {
trace_xfs_vm_readpages(mapping->host, 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); return mpage_readpages(mapping, pages, nr_pages, xfs_get_blocks);
} }
......
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