mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 10:10:00 +00:00
fsck.f2fs: support checkpoint=disable
This patch shows checkpoint is disabled and keeps the flag for next mount. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
a6cbb57192
commit
a48bda057a
@ -1998,6 +1998,8 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi)
|
||||
orphan_blks = __start_sum_addr(sbi) - 1;
|
||||
flags |= CP_ORPHAN_PRESENT_FLAG;
|
||||
}
|
||||
if (is_set_ckpt_flags(cp, CP_DISABLED_FLAG))
|
||||
flags |= CP_DISABLED_FLAG;
|
||||
|
||||
set_cp(cp_pack_total_block_count, 8 + orphan_blks + get_sb(cp_payload));
|
||||
|
||||
|
@ -424,6 +424,8 @@ void print_cp_state(u32 flag)
|
||||
MSG(0, "%s", " compacted_summary");
|
||||
if (flag & CP_ORPHAN_PRESENT_FLAG)
|
||||
MSG(0, "%s", " orphan_inodes");
|
||||
if (flag & CP_DISABLED_FLAG)
|
||||
MSG(0, "%s", " disabled");
|
||||
if (flag & CP_UMOUNT_FLAG)
|
||||
MSG(0, "%s", " unmount");
|
||||
else
|
||||
@ -2242,6 +2244,8 @@ void write_checkpoint(struct f2fs_sb_info *sbi)
|
||||
orphan_blks = __start_sum_addr(sbi) - 1;
|
||||
flags |= CP_ORPHAN_PRESENT_FLAG;
|
||||
}
|
||||
if (is_set_ckpt_flags(cp, CP_DISABLED_FLAG))
|
||||
flags |= CP_DISABLED_FLAG;
|
||||
|
||||
set_cp(free_segment_count, get_free_segments(sbi));
|
||||
set_cp(valid_block_count, sbi->total_valid_block_count);
|
||||
|
@ -635,6 +635,7 @@ struct f2fs_super_block {
|
||||
/*
|
||||
* For checkpoint
|
||||
*/
|
||||
#define CP_DISABLED_FLAG 0x00001000
|
||||
#define CP_LARGE_NAT_BITMAP_FLAG 0x00000400
|
||||
#define CP_NOCRC_RECOVERY_FLAG 0x00000200
|
||||
#define CP_TRIMMED_FLAG 0x00000100
|
||||
|
Loading…
Reference in New Issue
Block a user