linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iomap: skip unnecessary ifs_block_is_uptodate check
@ 2025-04-08 17:29 Gou Hao
  2025-04-09 15:30 ` Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gou Hao @ 2025-04-08 17:29 UTC (permalink / raw)
  To: brauner, djwong
  Cc: linux-xfs, linux-fsdevel, linux-kernel, wangyuli, gouhaojake

After the first 'for' loop, the first call to
ifs_block_is_uptodate always evaluates to 0.

Signed-off-by: Gou Hao <gouhao@uniontech.com>
---
 fs/iomap/buffered-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 31553372b33a..2f52e8e61240 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -259,7 +259,7 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,
 		}
 
 		/* truncate len if we find any trailing uptodate block(s) */
-		for ( ; i <= last; i++) {
+		for (i++; i <= last; i++) {
 			if (ifs_block_is_uptodate(ifs, i)) {
 				plen -= (last - i + 1) * block_size;
 				last = i - 1;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-04-11 14:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 17:29 [PATCH] iomap: skip unnecessary ifs_block_is_uptodate check Gou Hao
2025-04-09 15:30 ` Darrick J. Wong
2025-04-10  5:37   ` Gou Hao
2025-04-10  5:42 ` [PATCH V2] " Gou Hao
2025-04-10  5:54   ` Christoph Hellwig
2025-04-10  6:25     ` Gou Hao
2025-04-10  7:12 ` [PATCH V3] " Gou Hao
2025-04-10  7:17   ` Christoph Hellwig
2025-04-11 14:02   ` Christian Brauner

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).