aboutsummaryrefslogtreecommitdiffstats
path: root/fsck/main.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-01-14 16:18:15 -0800
committerJP Abgrall <jpa@google.com>2015-03-23 10:10:26 -0700
commit3bcf2237352307b2e9820e635097358eda3d356e (patch)
treedba9cc1b9233e64120f101c1cf0e8c37a93225de /fsck/main.c
parentf3b55c8ff22bfd7bfb5588637d08804aca9ac148 (diff)
downloadandroid_external_f2fs-tools-3bcf2237352307b2e9820e635097358eda3d356e.tar.gz
android_external_f2fs-tools-3bcf2237352307b2e9820e635097358eda3d356e.tar.bz2
android_external_f2fs-tools-3bcf2237352307b2e9820e635097358eda3d356e.zip
dump.f2fs: show checkpoint flag
This patch is to show the checkpoint flag. With this flag, we can guess the last status of the partition. And, this can be used by xfstests. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fsck/main.c')
-rw-r--r--fsck/main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fsck/main.c b/fsck/main.c
index e05e528..3606f62 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -157,6 +157,8 @@ static void do_fsck(struct f2fs_sb_info *sbi)
static void do_dump(struct f2fs_sb_info *sbi)
{
struct dump_option *opt = (struct dump_option *)config.private;
+ struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
+ u32 flag = le32_to_cpu(ckpt->ckpt_flags);
fsck_init(sbi);
@@ -172,6 +174,24 @@ static void do_dump(struct f2fs_sb_info *sbi)
dump_info_from_blkaddr(sbi, opt->blk_addr);
goto cleanup;
}
+
+ MSG(0, "Info: checkpoint state = %x : ", flag);
+ if (flag & CP_FSCK_FLAG)
+ MSG(0, "%s", " fsck");
+ if (flag & CP_ERROR_FLAG)
+ MSG(0, "%s", " error");
+ if (flag & CP_COMPACT_SUM_FLAG)
+ MSG(0, "%s", " compacted_summary");
+ if (flag & CP_ORPHAN_PRESENT_FLAG)
+ MSG(0, "%s", " orphan_inodes");
+ if (flag & CP_FASTBOOT_FLAG)
+ MSG(0, "%s", " fastboot");
+ if (flag & CP_UMOUNT_FLAG)
+ MSG(0, "%s", " unmount");
+ else
+ MSG(0, "%s", " sudden-power-off");
+ MSG(0, "\n");
+
dump_node(sbi, opt->nid);
cleanup:
fsck_free(sbi);