diff options
| author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2025-10-24 18:08:11 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-10-31 13:11:37 +0100 |
| commit | 6870892b6437bf7bdf37ca875bf842fe1e1385df (patch) | |
| tree | 3e86a1c94f630715754850127af6ccba0b2f437f | |
| parent | 48f3784b17d91457586fbbc292675206f166a138 (diff) | |
buffer: Use folio_next_pos()
This is one instruction more efficient than open-coding folio_pos() +
folio_size(). It's the equivalent of (x + y) << z rather than
x << z + y << z.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://patch.msgid.link/20251024170822.1427218-4-willy@infradead.org
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
| -rw-r--r-- | fs/buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 6a8752f7bbed..185ceb0d6baa 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2732,7 +2732,7 @@ int block_write_full_folio(struct folio *folio, struct writeback_control *wbc, loff_t i_size = i_size_read(inode); /* Is the folio fully inside i_size? */ - if (folio_pos(folio) + folio_size(folio) <= i_size) + if (folio_next_pos(folio) <= i_size) return __block_write_full_folio(inode, folio, get_block, wbc); /* Is the folio fully outside i_size? (truncate in progress) */ |