]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
f2fs: Pass a folio to cpver_of_node()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 8 Jul 2025 17:03:22 +0000 (18:03 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 22 Jul 2025 15:56:28 +0000 (15:56 +0000)
All callers have a folio so pass it in.

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
fs/f2fs/node.h

index 6ac1540d6aabed9620adc8ba823a8c3c6a161d32..1e7bec223dbe5a27f6b409bac04740ea67782892 100644 (file)
@@ -1485,7 +1485,7 @@ static int sanity_check_node_footer(struct f2fs_sb_info *sbi,
                f2fs_warn(sbi, "inconsistent node block, node_type:%d, nid:%lu, "
                          "node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
                          ntype, nid, nid_of_node(folio), ino_of_node(folio),
-                         ofs_of_node(page), cpver_of_node(page),
+                         ofs_of_node(page), cpver_of_node(folio),
                          next_blkaddr_of_node(folio));
                set_sbi_flag(sbi, SBI_NEED_FSCK);
                f2fs_handle_error(sbi, ERROR_INCONSISTENT_FOOTER);
index a80be47cd2e57fe1d6a91b1ea098be7ab08babae..78a9a411fe77ffc1b44b42a18fb397c61594c6ec 100644 (file)
@@ -262,9 +262,9 @@ static inline unsigned int ofs_of_node(const struct page *node_page)
        return flag >> OFFSET_BIT_SHIFT;
 }
 
-static inline __u64 cpver_of_node(const struct page *node_page)
+static inline __u64 cpver_of_node(const struct folio *node_folio)
 {
-       struct f2fs_node *rn = F2FS_NODE(node_page);
+       struct f2fs_node *rn = F2FS_NODE(&node_folio->page);
        return le64_to_cpu(rn->footer.cp_ver);
 }
 
@@ -321,12 +321,12 @@ static inline bool is_recoverable_dnode(const struct folio *folio)
 
        /* Don't care crc part, if fsck.f2fs sets it. */
        if (__is_set_ckpt_flags(ckpt, CP_NOCRC_RECOVERY_FLAG))
-               return (cp_ver << 32) == (cpver_of_node(&folio->page) << 32);
+               return (cp_ver << 32) == (cpver_of_node(folio) << 32);
 
        if (__is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG))
                cp_ver |= (cur_cp_crc(ckpt) << 32);
 
-       return cp_ver == cpver_of_node(&folio->page);
+       return cp_ver == cpver_of_node(folio);
 }
 
 /*