From 3c97b32131e83c934b3d340eeb75284e898380c4 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Thu, 5 Feb 2015 18:48:22 -0800 Subject: [PATCH] osd: Dump header in FileJournal::dump() Signed-off-by: David Zafman --- src/os/FileJournal.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 3130ac9c7c8e1..c294352cfe886 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -588,8 +588,22 @@ int FileJournal::dump(ostream& out) read_pos = header.start; JSONFormatter f(true); + f.open_object_section("journal"); + + f.open_object_section("header"); + f.dump_unsigned("flags", header.flags); + ostringstream os; + os << header.fsid; + f.dump_string("fsid", os.str()); + f.dump_unsigned("block_size", header.block_size); + f.dump_unsigned("alignment", header.alignment); + f.dump_int("max_size", header.max_size); + f.dump_int("start", header.start); + f.dump_unsigned("committed_up_to", header.committed_up_to); + f.dump_unsigned("start_seq", header.start_seq); + f.close_section(); - f.open_array_section("journal"); + f.open_array_section("entries"); uint64_t seq = 0; while (1) { bufferlist bl; @@ -618,6 +632,7 @@ int FileJournal::dump(ostream& out) f.close_section(); } + f.close_section(); f.close_section(); f.flush(out); dout(10) << "dump finish" << dendl; -- 2.39.5