]> Gentwo Git Trees - linux/.git/commitdiff
f2fs: Use folio_next_pos()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 24 Oct 2025 17:08:13 +0000 (18:08 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 31 Oct 2025 12:11:38 +0000 (13:11 +0100)
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-6-willy@infradead.org
Reviewed-by: Chao Yu <chao@kernel.org>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/f2fs/compress.c

index 6ad8d3bc6df7a8dcb304e8dd9795588d0802ec02..be53e06caf3da30e2f7a8e00a543e9ef3c11e68a 100644 (file)
@@ -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)