summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2025-07-08 18:03:09 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2025-07-22 15:55:53 +0000
commitbead9a6f1b8d22a2e8185a380a4738cb737d0d70 (patch)
tree057e605038534a8c7807c1a79735d2e579201ca6 /fs/f2fs/node.h
parentf2fs: Pass a folio to nid_of_node() (diff)
downloadlinux-bead9a6f1b8d22a2e8185a380a4738cb737d0d70.tar.gz
linux-bead9a6f1b8d22a2e8185a380a4738cb737d0d70.zip
f2fs: Pass a folio to is_recoverable_dnode()
All callers have a folio so pass it in. Also make the argument const as the function does not modify it. Removes a call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.h')
-rw-r--r--fs/f2fs/node.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h
index a4ffb9460ee9..76dae4ab57d2 100644
--- a/fs/f2fs/node.h
+++ b/fs/f2fs/node.h
@@ -262,7 +262,7 @@ static inline unsigned int ofs_of_node(const struct page *node_page)
return flag >> OFFSET_BIT_SHIFT;
}
-static inline __u64 cpver_of_node(struct page *node_page)
+static inline __u64 cpver_of_node(const struct page *node_page)
{
struct f2fs_node *rn = F2FS_NODE(node_page);
return le64_to_cpu(rn->footer.cp_ver);
@@ -313,19 +313,19 @@ static inline void fill_node_footer_blkaddr(struct page *page, block_t blkaddr)
rn->footer.next_blkaddr = cpu_to_le32(blkaddr);
}
-static inline bool is_recoverable_dnode(struct page *page)
+static inline bool is_recoverable_dnode(const struct folio *folio)
{
- struct f2fs_checkpoint *ckpt = F2FS_CKPT(F2FS_P_SB(page));
+ struct f2fs_checkpoint *ckpt = F2FS_CKPT(F2FS_F_SB(folio));
__u64 cp_ver = cur_cp_version(ckpt);
/* 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(page) << 32);
+ return (cp_ver << 32) == (cpver_of_node(&folio->page) << 32);
if (__is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG))
cp_ver |= (cur_cp_crc(ckpt) << 32);
- return cp_ver == cpver_of_node(page);
+ return cp_ver == cpver_of_node(&folio->page);
}
/*