From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH] fsck.f2fs: support checkpoint=disable
Date: Wed, 26 Sep 2018 22:27:40 -0700 [thread overview]
Message-ID: <20180927052740.75568-1-jaegeuk@kernel.org> (raw)
This patch shows checkpoint is disabled and keeps the flag for next mount.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fsck/fsck.c | 2 ++
fsck/mount.c | 4 ++++
include/f2fs_fs.h | 1 +
3 files changed, 7 insertions(+)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 19220e2..ca4e74e 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -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));
diff --git a/fsck/mount.c b/fsck/mount.c
index 2b0289e..21e1dc8 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -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);
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index dab8b40..e3b4529 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -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
--
2.17.0.441.gb46fe60e1d-goog
reply other threads:[~2018-09-27 5:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180927052740.75568-1-jaegeuk@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).