From: Matthew Wilcox (Oracle) Date: Fri, 24 Oct 2025 17:08:13 +0000 (+0100) Subject: f2fs: Use folio_next_pos() X-Git-Tag: v6.19-rc1~246^2~1^2~5 X-Git-Url: https://gentwo.org/gitweb/?a=commitdiff_plain;h=4fcafa30b70a9cecc1ca04fbeec95a61b52b9d35;p=linux%2F.git f2fs: 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) Link: https://patch.msgid.link/20251024170822.1427218-6-willy@infradead.org Reviewed-by: Chao Yu Cc: Jaegeuk Kim Cc: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Christian Brauner --- diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 6ad8d3bc6df7..be53e06caf3d 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1329,7 +1329,7 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, } folio = page_folio(cc->rpages[last_index]); - psize = folio_pos(folio) + folio_size(folio); + psize = folio_next_pos(folio); err = f2fs_get_node_info(fio.sbi, dn.nid, &ni, false); if (err)