From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: [PATCH 2/3] fs: remove the buffer_unwritten check in page_seek_hole_data
Date: Wed, 30 May 2018 12:02:07 +0200 [thread overview]
Message-ID: <20180530100208.31490-3-hch@lst.de> (raw)
In-Reply-To: <20180530100208.31490-1-hch@lst.de>
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>
---
fs/iomap.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/fs/iomap.c b/fs/iomap.c
index c2d4fd551fed..e75153f52748 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -816,14 +816,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;
@@ -835,8 +830,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.
*/
--
2.17.0
next prev parent reply other threads:[~2018-05-30 10:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 10:02 iomap SEEK_HOLE / SEEK_DATA cleanups and generalization Christoph Hellwig
2018-05-30 10:02 ` [PATCH 1/3] fs: move page_cache_seek_hole_data to iomap.c Christoph Hellwig
2018-05-30 22:46 ` Dave Chinner
2018-05-30 10:02 ` Christoph Hellwig [this message]
2018-05-30 22:47 ` [PATCH 2/3] fs: remove the buffer_unwritten check in page_seek_hole_data Dave Chinner
2018-05-30 10:02 ` [PATCH 3/3] fs: use ->is_partially_uptodate in page_cache_seek_hole_data Christoph Hellwig
2018-05-30 13:48 ` Andreas Grünbacher
2018-05-30 23:00 ` Dave Chinner
2018-05-31 6:20 ` Christoph Hellwig
2018-05-30 16:07 ` iomap SEEK_HOLE / SEEK_DATA cleanups and generalization Darrick J. Wong
2018-05-30 16:17 ` Christoph Hellwig
2018-05-30 16:25 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2018-05-31 18:07 iomap SEEK_HOLE / SEEK_DATA cleanups and generalization v2 Christoph Hellwig
2018-05-31 18:07 ` [PATCH 2/3] fs: remove the buffer_unwritten check in page_seek_hole_data Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180530100208.31490-3-hch@lst.de \
--to=hch@lst.de \
--cc=agruenba@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).