]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: EResetJournal modernization for dencoder
authorGreg Farnum <greg@inktank.com>
Sun, 3 Feb 2013 23:45:12 +0000 (15:45 -0800)
committerGreg Farnum <greg@inktank.com>
Fri, 8 Feb 2013 21:17:53 +0000 (13:17 -0800)
Signed-off-by: Greg Farnum <greg@inktank.com>
src/mds/events/EResetJournal.h
src/mds/journal.cc
src/test/encoding/types.h

index e85d2221926f60a02691a659764d4b2004b6dcb0..7fc3847d2adf74ba3971352d33fc536180ddfa8b 100644 (file)
@@ -24,17 +24,10 @@ class EResetJournal : public LogEvent {
   EResetJournal() : LogEvent(EVENT_RESETJOURNAL) { }
   ~EResetJournal() {}
 
-  void encode(bufferlist& bl) const {
-    ENCODE_START(2, 2, bl);
-    ::encode(stamp, bl);
-    ENCODE_FINISH(bl);
-  }
-  void decode(bufferlist::iterator &bl) {
-    DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
-    ::decode(stamp, bl);
-    DECODE_FINISH(bl);
-  }
-
+  void encode(bufferlist& bl) const;
+  void decode(bufferlist::iterator& bl);
+  void dump(Formatter *f) const;
+  static void generate_test_instances(list<EResetJournal*>& ls);
   void print(ostream& out) {
     out << "EResetJournal";
   }
index 8b2298fac6cb573e3ce15233098d6902360dd2a6..81dcc087b88ae937344206bb76d2cf03889dcb44 100644 (file)
@@ -2113,6 +2113,30 @@ void EImportFinish::generate_test_instances(list<EImportFinish*>& ls)
 // ------------------------
 // EResetJournal
 
+void EResetJournal::encode(bufferlist& bl) const
+{
+  ENCODE_START(2, 2, bl);
+  ::encode(stamp, bl);
+  ENCODE_FINISH(bl);
+}
+void EResetJournal::decode(bufferlist::iterator &bl)
+{
+  DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
+  ::decode(stamp, bl);
+  DECODE_FINISH(bl);
+}
+
+void EResetJournal::dump(Formatter *f) const
+{
+  f->dump_stream("timestamp") << stamp;
+}
+
+void EResetJournal::generate_test_instances(list<EResetJournal*>& ls)
+{
+  ls.push_back(new EResetJournal());
+}
+
 void EResetJournal::replay(MDS *mds)
 {
   dout(1) << "EResetJournal" << dendl;
index 3154565cd0b4b9ac1cd35c2e0dd0dd5bb17a22bd..e1c23c91a545faa385923115ea24fdfba74a3e7d 100644 (file)
@@ -141,6 +141,8 @@ TYPE(EMetaBlob::dirlump)
 TYPE(EMetaBlob)
 #include "mds/events/EOpen.h"
 TYPE(EOpen)
+#include "mds/events/EResetJournal.h"
+TYPE(EResetJournal)
 
 #ifdef WITH_RADOSGW