linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsck.f2fs: show ckeckpoint version info
@ 2015-04-16  7:31 Jaegeuk Kim
  0 siblings, 0 replies; only message in thread
From: Jaegeuk Kim @ 2015-04-16  7:31 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-16  7:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16  7:31 [PATCH] fsck.f2fs: show ckeckpoint version info Jaegeuk Kim

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).