diff mbox series

[f2fs-dev] f2fs-tools: cleanup is_sit_bitmap_set

Message ID 20240712020133.140148-1-shengyong@oppo.com (mailing list archive)
State New
Headers show
Series [f2fs-dev] f2fs-tools: cleanup is_sit_bitmap_set | expand

Commit Message

Sheng Yong July 12, 2024, 2:01 a.m. UTC
Remove redundant function definition of is_sit_bitmap_set() and
export it.

Signed-off-by: Sheng Yong <shengyong@oppo.com>
---
 fsck/dump.c |  2 +-
 fsck/fsck.c | 12 ------------
 fsck/fsck.h |  2 +-
 3 files changed, 2 insertions(+), 14 deletions(-)

Comments

Chao Yu July 12, 2024, 7:13 a.m. UTC | #1
On 2024/7/12 10:01, Sheng Yong wrote:
> Remove redundant function definition of is_sit_bitmap_set() and
> export it.
> 
> Signed-off-by: Sheng Yong <shengyong@oppo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
diff mbox series

Patch

diff --git a/fsck/dump.c b/fsck/dump.c
index 90e3e0e93c61..4c1d4d3cdb19 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -660,7 +660,7 @@  dump:
 	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 7400dcf35a11..e2fb042d3dec 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -633,18 +633,6 @@  err:
 	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 6cac926037bb..79cf08522873 100644
--- a/fsck/fsck.h
+++ b/fsck/fsck.h
@@ -281,7 +281,7 @@  extern int dump_node(struct f2fs_sb_info *, nid_t, int, char *, int, int);
 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);