All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/3 v2] dump.f2fs: show checkpoint flag
Date: Thu, 29 Jan 2015 13:43:27 -0800	[thread overview]
Message-ID: <20150129214327.GA17672@jaegeuk-mac02> (raw)
In-Reply-To: <1421974132-18330-2-git-send-email-jaegeuk@kernel.org>

Change log from v1:
 o add FASTBOOT_FLAG

>From b57708aecf07a7caa8fcce02f65735a11e987154 Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Wed, 14 Jan 2015 16:18:15 -0800
Subject: [PATCH] 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>
---
 fsck/main.c       | 20 ++++++++++++++++++++
 include/f2fs_fs.h |  1 +
 2 files changed, 21 insertions(+)

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);
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 4dc2426..d062b7f 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -358,6 +358,7 @@ struct f2fs_super_block {
 /*
  * For checkpoint
  */
+#define CP_FASTBOOT_FLAG	0x00000020
 #define CP_FSCK_FLAG		0x00000010
 #define CP_ERROR_FLAG		0x00000008
 #define CP_COMPACT_SUM_FLAG	0x00000004
-- 
2.1.1


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

  reply	other threads:[~2015-01-29 21:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  0:48 [PATCH 1/3] fsck.f2fs: fix sit types seamlessly Jaegeuk Kim
2015-01-23  0:48 ` [PATCH 2/3] dump.f2fs: show checkpoint flag Jaegeuk Kim
2015-01-29 21:43   ` Jaegeuk Kim [this message]
2015-01-23  0:48 ` [PATCH 3/3] fsck.f2fs: readahead node blocks to speed up Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150129214327.GA17672@jaegeuk-mac02 \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.