]> 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>
Thu, 25 Feb 2016 20:50:21 +0000 (12:50 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 3c97b32131e83c934b3d340eeb75284e898380c4)

src/os/FileJournal.cc

index d0b9563def06d74c2a8499b979f52944f7a78553..34082cdb5bdefefe46328af5548018129c4f4568 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;