From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH] fsck.f2fs: show ckeckpoint version info
Date: Thu, 16 Apr 2015 00:31:11 -0700 [thread overview]
Message-ID: <1429169471-18383-1-git-send-email-jaegeuk@kernel.org> (raw)
This patch shows the valid checkpoint version number.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fsck/mount.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fsck/mount.c b/fsck/mount.c
index f900dd7..1c55f40 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -400,7 +400,7 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi)
struct f2fs_super_block *raw_sb = sbi->raw_super;
void *cp1, *cp2, *cur_page;
unsigned long blk_size = sbi->blocksize;
- unsigned long long cp1_version = 0, cp2_version = 0;
+ unsigned long long cp1_version = 0, cp2_version = 0, version;
unsigned long long cp_start_blk_no;
unsigned int cp_blks = 1 + le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload);
int ret;
@@ -423,22 +423,28 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi)
if (ver_after(cp2_version, cp1_version)) {
cur_page = cp2;
sbi->cur_cp = 2;
+ version = cp2_version;
} else {
cur_page = cp1;
sbi->cur_cp = 1;
+ version = cp1_version;
}
} else if (cp1) {
cur_page = cp1;
sbi->cur_cp = 1;
+ version = cp1_version;
} else if (cp2) {
cur_page = cp2;
sbi->cur_cp = 2;
+ version = cp2_version;
} else {
free(cp1);
free(cp2);
goto fail_no_cp;
}
+ MSG(0, "Info: CKPT version = %"PRIx64"\n", version);
+
memcpy(sbi->ckpt, cur_page, blk_size);
if (cp_blks > 1) {
--
2.1.1
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
reply other threads:[~2015-04-16 7:31 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=1429169471-18383-1-git-send-email-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).