]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Dump header in FileJournal::dump()
authorDavid Zafman <dzafman@redhat.com>
Fri, 6 Feb 2015 02:48:22 +0000 (18:48 -0800)
committerDavid Zafman <dzafman@redhat.com>
Wed, 13 May 2015 20:09:11 +0000 (13:09 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/os/FileJournal.cc

index 3130ac9c7c8e14a94f7bc2b25f07cf8176247831..c294352cfe886491cab0f6b79e3556c6d8e68b64 100644 (file)
@@ -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;