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

fs: remove the buffer_unwritten check in page_seek_hole_data

We only call into this function through the iomap iterators, so we already
know the buffer is unwritten.  In addition to that we always require the
uptodate flag that is ORed with the result anyway.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 8a78cb1f
...@@ -615,14 +615,9 @@ page_seek_hole_data(struct page *page, loff_t lastoff, int whence) ...@@ -615,14 +615,9 @@ page_seek_hole_data(struct page *page, loff_t lastoff, int whence)
continue; continue;
/* /*
* Unwritten extents that have data in the page cache covering * Any buffer with valid data in it should have BH_Uptodate set.
* them can be identified by the BH_Unwritten state flag.
* Pages with multiple buffers might have a mix of holes, data
* and unwritten extents - any buffer with valid data in it
* should have BH_Uptodate flag set on it.
*/ */
if (buffer_uptodate(bh) == seek_data)
if ((buffer_unwritten(bh) || buffer_uptodate(bh)) == seek_data)
return lastoff; return lastoff;
lastoff = offset; lastoff = offset;
...@@ -634,8 +629,8 @@ page_seek_hole_data(struct page *page, loff_t lastoff, int whence) ...@@ -634,8 +629,8 @@ page_seek_hole_data(struct page *page, loff_t lastoff, int whence)
* Seek for SEEK_DATA / SEEK_HOLE in the page cache. * Seek for SEEK_DATA / SEEK_HOLE in the page cache.
* *
* Within unwritten extents, the page cache determines which parts are holes * Within unwritten extents, the page cache determines which parts are holes
* and which are data: unwritten and uptodate buffer heads count as data; * and which are data: uptodate buffer heads count as data; everything else
* everything else counts as a hole. * counts as a hole.
* *
* Returns the resulting offset on successs, and -ENOENT otherwise. * Returns the resulting offset on successs, and -ENOENT otherwise.
*/ */
......
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