aboutsummaryrefslogtreecommitdiffstats
path: root/fs/iomap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-06-01 09:05:14 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-06-01 18:37:33 -0700
commitbd56b3e14410b8cf6a4c13c94f7065341b179517 (patch)
tree9219eb7b6e88a9f7dbcb3bd14b31a523ac5412e4 /fs/iomap.c
parentfs: move page_cache_seek_hole_data to iomap.c (diff)
downloadlinux-dev-bd56b3e14410b8cf6a4c13c94f7065341b179517.tar.xz
linux-dev-bd56b3e14410b8cf6a4c13c94f7065341b179517.zip
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/iomap.c')
-rw-r--r--fs/iomap.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/iomap.c b/fs/iomap.c
index fe3b9222dd46..2a20d50f0c1d 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -615,14 +615,9 @@ page_seek_hole_data(struct page *page, loff_t lastoff, int whence)
continue;
/*
- * Unwritten extents that have data in the page cache covering
- * 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.
+ * Any buffer with valid data in it should have BH_Uptodate set.
*/
-
- if ((buffer_unwritten(bh) || buffer_uptodate(bh)) == seek_data)
+ if (buffer_uptodate(bh) == seek_data)
return lastoff;
lastoff = offset;
@@ -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.
*
* Within unwritten extents, the page cache determines which parts are holes
- * and which are data: unwritten and uptodate buffer heads count as data;
- * everything else counts as a hole.
+ * and which are data: uptodate buffer heads count as data; everything else
+ * counts as a hole.
*
* Returns the resulting offset on successs, and -ENOENT otherwise.
*/