From 8916de7b4641293009d6e7fbf6cc78c27a433138 Mon Sep 17 00:00:00 2001 From: Sheng Yong Date: Fri, 12 Jul 2024 10:01:29 +0800 Subject: [PATCH] f2fs-tools: cleanup is_sit_bitmap_set Remove redundant function definition of is_sit_bitmap_set() and export it. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fsck/dump.c | 2 +- fsck/fsck.c | 12 ------------ fsck/fsck.h | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 403d9b8f..457e9c2b 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -723,7 +723,7 @@ static int dump_filesystem(struct f2fs_sb_info *sbi, struct node_info *ni, return 0; } -static bool is_sit_bitmap_set(struct f2fs_sb_info *sbi, u32 blk_addr) +bool is_sit_bitmap_set(struct f2fs_sb_info *sbi, u32 blk_addr) { struct seg_entry *se; u32 offset; diff --git a/fsck/fsck.c b/fsck/fsck.c index 6926f8f5..a18bee9d 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -633,18 +633,6 @@ int fsck_chk_node_blk(struct f2fs_sb_info *sbi, struct f2fs_inode *inode, return -EINVAL; } -static bool is_sit_bitmap_set(struct f2fs_sb_info *sbi, u32 blk_addr) -{ - struct seg_entry *se; - u32 offset; - - se = get_seg_entry(sbi, GET_SEGNO(sbi, blk_addr)); - offset = OFFSET_IN_SEG(sbi, blk_addr); - - return f2fs_test_bit(offset, - (const char *)se->cur_valid_map) != 0; -} - int fsck_chk_root_inode(struct f2fs_sb_info *sbi) { struct f2fs_node *node_blk; diff --git a/fsck/fsck.h b/fsck/fsck.h index 31ab6daf..a8f187e0 100644 --- a/fsck/fsck.h +++ b/fsck/fsck.h @@ -284,7 +284,7 @@ extern int dump_node(struct f2fs_sb_info *, nid_t, int, char *, int, int, char * extern int dump_info_from_blkaddr(struct f2fs_sb_info *, u32); extern unsigned int start_bidx_of_node(unsigned int, struct f2fs_node *); extern void dump_node_scan_disk(struct f2fs_sb_info *sbi, nid_t nid); - +extern bool is_sit_bitmap_set(struct f2fs_sb_info *sbi, u32 blk_addr); /* defrag.c */ int f2fs_defragment(struct f2fs_sb_info *, u64, u64, u64, int);