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:
Jaegeuk Kim 2018-09-20 16:16:07 -07:00
parent a6cbb57192
commit a48bda057a
3 changed files with 7 additions and 0 deletions

View File

@ -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));

View File

@ -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);

View File

@ -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