f2fs: Pass an address to scan_nat_page()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:10:58 +0000 (21:10 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Apr 2025 15:26:31 +0000 (15:26 +0000)
Remove a conversion from folio to page by passing in the address of the
first byte rather than the struct page containing it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c

index 77ca3b5ce285bb5e1cd031b0f15b2a8b85a965ac..bea66ccd81528bf151bf3b015af8fdcd003e5c08 100644 (file)
@@ -2421,10 +2421,9 @@ static void remove_free_nid(struct f2fs_sb_info *sbi, nid_t nid)
 }
 
 static int scan_nat_page(struct f2fs_sb_info *sbi,
-                       struct page *nat_page, nid_t start_nid)
+                       struct f2fs_nat_block *nat_blk, nid_t start_nid)
 {
        struct f2fs_nm_info *nm_i = NM_I(sbi);
-       struct f2fs_nat_block *nat_blk = page_address(nat_page);
        block_t blk_addr;
        unsigned int nat_ofs = NAT_BLOCK_OFFSET(start_nid);
        int i;
@@ -2549,7 +2548,8 @@ static int __f2fs_build_free_nids(struct f2fs_sb_info *sbi,
                        if (IS_ERR(folio)) {
                                ret = PTR_ERR(folio);
                        } else {
-                               ret = scan_nat_page(sbi, &folio->page, nid);
+                               ret = scan_nat_page(sbi, folio_address(folio),
+                                               nid);
                                f2fs_folio_put(folio, true);
                        }