From 358cce1e7f45cf3cdef1e15929cc02f74048a177 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 Nov 2015 17:06:44 -0500 Subject: [PATCH] mds: pass features to LogEvents, EMetaBlob Signed-off-by: Sage Weil --- src/mds/LogEvent.h | 6 ++-- src/mds/MDLog.cc | 4 +-- src/mds/events/ECommitted.h | 3 +- src/mds/events/EExport.h | 3 +- src/mds/events/EFragment.h | 3 +- src/mds/events/EImportFinish.h | 3 +- src/mds/events/EImportStart.h | 3 +- src/mds/events/EMetaBlob.h | 20 ++++++------ src/mds/events/ENoOp.h | 3 +- src/mds/events/EOpen.h | 3 +- src/mds/events/EResetJournal.h | 3 +- src/mds/events/ESession.h | 3 +- src/mds/events/ESessions.h | 3 +- src/mds/events/ESlaveUpdate.h | 3 +- src/mds/events/ESubtreeMap.h | 3 +- src/mds/events/ETableClient.h | 3 +- src/mds/events/ETableServer.h | 3 +- src/mds/events/EUpdate.h | 3 +- src/mds/journal.cc | 58 ++++++++++++++++----------------- src/test/encoding/types.h | 34 +++++++++---------- src/tools/cephfs/EventOutput.cc | 2 +- src/tools/cephfs/JournalTool.cc | 4 +-- src/tools/cephfs/Resetter.cc | 2 +- 23 files changed, 95 insertions(+), 80 deletions(-) diff --git a/src/mds/LogEvent.h b/src/mds/LogEvent.h index bf57db00e330..8c1cd1b07f5a 100644 --- a/src/mds/LogEvent.h +++ b/src/mds/LogEvent.h @@ -84,16 +84,16 @@ public: void set_stamp(utime_t t) { stamp = t; } // encoding - virtual void encode(bufferlist& bl) const = 0; + virtual void encode(bufferlist& bl, uint64_t features) const = 0; virtual void decode(bufferlist::iterator &bl) = 0; static LogEvent *decode(bufferlist &bl); virtual void dump(Formatter *f) const = 0; - void encode_with_header(bufferlist& bl) { + void encode_with_header(bufferlist& bl, uint64_t features) { ::encode(EVENT_NEW_ENCODING, bl); ENCODE_START(1, 1, bl) ::encode(_type, bl); - encode(bl); + encode(bl, features); ENCODE_FINISH(bl); } diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 86a194578591..fce20124687a 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -382,7 +382,7 @@ void MDLog::_submit_thread() LogSegment *ls = le->_segment; // encode it, with event type bufferlist bl; - le->encode_with_header(bl); + le->encode_with_header(bl, mds->mdsmap->get_up_features()); uint64_t write_pos = journaler->get_write_pos(); @@ -1134,7 +1134,7 @@ void MDLog::_reformat_journal(JournalPointer const &jp_in, Journaler *old_journa if (modified) { bl.clear(); - le->encode_with_header(bl); + le->encode_with_header(bl, mds->mdsmap->get_up_features()); } delete le; diff --git a/src/mds/events/ECommitted.h b/src/mds/events/ECommitted.h index 4cdbbfbe44ff..67e312c9918b 100644 --- a/src/mds/events/ECommitted.h +++ b/src/mds/events/ECommitted.h @@ -30,7 +30,7 @@ public: out << "ECommitted " << reqid; } - void encode(bufferlist &bl) const; + void encode(bufferlist &bl, uint64_t features) const; void decode(bufferlist::iterator &bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -38,5 +38,6 @@ public: void update_segment() {} void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(ECommitted) #endif diff --git a/src/mds/events/EExport.h b/src/mds/events/EExport.h index 64a33738902b..0690aec2f5a6 100644 --- a/src/mds/events/EExport.h +++ b/src/mds/events/EExport.h @@ -44,12 +44,13 @@ public: EMetaBlob *get_metablob() { return &metablob; } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator &bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(EExport) #endif diff --git a/src/mds/events/EFragment.h b/src/mds/events/EFragment.h index fac7d36b01ba..4cc2c368d956 100644 --- a/src/mds/events/EFragment.h +++ b/src/mds/events/EFragment.h @@ -70,11 +70,12 @@ public: EMetaBlob *get_metablob() { return &metablob; } - void encode(bufferlist &bl) const; + void encode(bufferlist &bl, uint64_t features) const; void decode(bufferlist::iterator &bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(EFragment) #endif diff --git a/src/mds/events/EImportFinish.h b/src/mds/events/EImportFinish.h index 4129a4ca9957..bd04ef516cc9 100644 --- a/src/mds/events/EImportFinish.h +++ b/src/mds/events/EImportFinish.h @@ -40,7 +40,7 @@ class EImportFinish : public LogEvent { out << " failed"; } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator &bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -48,5 +48,6 @@ class EImportFinish : public LogEvent { void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(EImportFinish) #endif diff --git a/src/mds/events/EImportStart.h b/src/mds/events/EImportStart.h index 9f47d49bf826..cebf8481a289 100644 --- a/src/mds/events/EImportStart.h +++ b/src/mds/events/EImportStart.h @@ -47,7 +47,7 @@ protected: EMetaBlob *get_metablob() { return &metablob; } - void encode(bufferlist &bl) const; + void encode(bufferlist &bl, uint64_t features) const; void decode(bufferlist::iterator &bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -56,5 +56,6 @@ protected: void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(EImportStart) #endif diff --git a/src/mds/events/EMetaBlob.h b/src/mds/events/EMetaBlob.h index 8db8f6738c59..77f8c3c43be7 100644 --- a/src/mds/events/EMetaBlob.h +++ b/src/mds/events/EMetaBlob.h @@ -100,7 +100,7 @@ public: fullbit() {} ~fullbit() {} - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator &bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -130,7 +130,7 @@ public: return state_string; } }; - WRITE_CLASS_ENCODER(fullbit) + WRITE_CLASS_ENCODER_FEATURES(fullbit) /* remotebit - a dentry + remote inode link (i.e. just an ino) */ @@ -262,9 +262,9 @@ public: } // if this changes, update the versioning in encode for it! - void _encode_bits() const { + void _encode_bits(uint64_t features) const { if (!dn_decoded) return; - ::encode(dfull, dnbl); + ::encode(dfull, dnbl, features); ::encode(dremote, dnbl); ::encode(dnull, dnbl); } @@ -277,12 +277,12 @@ public: dn_decoded = true; } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator &bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); }; - WRITE_CLASS_ENCODER(dirlump) + WRITE_CLASS_ENCODER_FEATURES(dirlump) // my lumps. preserve the order we added them in a list. list lump_order; @@ -317,7 +317,7 @@ private: list > client_flushes; public: - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void get_inodes(std::set &inodes) const; void get_paths(std::vector &paths) const; @@ -580,11 +580,11 @@ private: void update_segment(LogSegment *ls); void replay(MDSRank *mds, LogSegment *ls, MDSlaveUpdate *su=NULL); }; -WRITE_CLASS_ENCODER(EMetaBlob) -WRITE_CLASS_ENCODER(EMetaBlob::fullbit) +WRITE_CLASS_ENCODER_FEATURES(EMetaBlob) +WRITE_CLASS_ENCODER_FEATURES(EMetaBlob::fullbit) WRITE_CLASS_ENCODER(EMetaBlob::remotebit) WRITE_CLASS_ENCODER(EMetaBlob::nullbit) -WRITE_CLASS_ENCODER(EMetaBlob::dirlump) +WRITE_CLASS_ENCODER_FEATURES(EMetaBlob::dirlump) inline ostream& operator<<(ostream& out, const EMetaBlob& t) { t.print(out); diff --git a/src/mds/events/ENoOp.h b/src/mds/events/ENoOp.h index ed825c6b8d4c..4b26fe6214f4 100644 --- a/src/mds/events/ENoOp.h +++ b/src/mds/events/ENoOp.h @@ -24,11 +24,12 @@ public: ENoOp() : LogEvent(EVENT_NOOP), pad_size(0) { } explicit ENoOp(uint32_t size_) : LogEvent(EVENT_NOOP), pad_size(size_){ } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const {} void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(ENoOp) #endif diff --git a/src/mds/events/EOpen.h b/src/mds/events/EOpen.h index 0c1175baf1a6..c48d7350546e 100644 --- a/src/mds/events/EOpen.h +++ b/src/mds/events/EOpen.h @@ -44,7 +44,7 @@ public: inos.push_back(ino); } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -52,5 +52,6 @@ public: void update_segment(); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(EOpen) #endif diff --git a/src/mds/events/EResetJournal.h b/src/mds/events/EResetJournal.h index 5f7e9a3d42ab..717781e0cd71 100644 --- a/src/mds/events/EResetJournal.h +++ b/src/mds/events/EResetJournal.h @@ -24,7 +24,7 @@ class EResetJournal : public LogEvent { EResetJournal() : LogEvent(EVENT_RESETJOURNAL) { } ~EResetJournal() {} - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -34,5 +34,6 @@ class EResetJournal : public LogEvent { void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(EResetJournal) #endif diff --git a/src/mds/events/ESession.h b/src/mds/events/ESession.h index c3b2fc0ae39f..9fe6b6fc38b0 100644 --- a/src/mds/events/ESession.h +++ b/src/mds/events/ESession.h @@ -51,7 +51,7 @@ class ESession : public LogEvent { cmapv(v), inos(i), inotablev(iv) { } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -69,5 +69,6 @@ class ESession : public LogEvent { void replay(MDSRank *mds); entity_inst_t get_client_inst() const {return client_inst;} }; +WRITE_CLASS_ENCODER_FEATURES(ESession) #endif diff --git a/src/mds/events/ESessions.h b/src/mds/events/ESessions.h index 5b5b5945905d..35a6ce74c2d8 100644 --- a/src/mds/events/ESessions.h +++ b/src/mds/events/ESessions.h @@ -38,7 +38,7 @@ public: void mark_old_encoding() { old_style_encode = true; } - void encode(bufferlist &bl) const; + void encode(bufferlist &bl, uint64_t features) const; void decode_old(bufferlist::iterator &bl); void decode_new(bufferlist::iterator &bl); void decode(bufferlist::iterator &bl) { @@ -55,5 +55,6 @@ public: void update_segment(); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(ESessions) #endif diff --git a/src/mds/events/ESlaveUpdate.h b/src/mds/events/ESlaveUpdate.h index 41e1bb01e03c..7b22935f824f 100644 --- a/src/mds/events/ESlaveUpdate.h +++ b/src/mds/events/ESlaveUpdate.h @@ -138,12 +138,13 @@ public: EMetaBlob *get_metablob() { return &commit; } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(ESlaveUpdate) #endif diff --git a/src/mds/events/ESubtreeMap.h b/src/mds/events/ESubtreeMap.h index 9a5f193b4053..e021ecc114c8 100644 --- a/src/mds/events/ESubtreeMap.h +++ b/src/mds/events/ESubtreeMap.h @@ -36,12 +36,13 @@ public: EMetaBlob *get_metablob() { return &metablob; } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(ESubtreeMap) #endif diff --git a/src/mds/events/ETableClient.h b/src/mds/events/ETableClient.h index aaa1664f6184..97b220767a53 100644 --- a/src/mds/events/ETableClient.h +++ b/src/mds/events/ETableClient.h @@ -31,7 +31,7 @@ struct ETableClient : public LogEvent { LogEvent(EVENT_TABLECLIENT), table(t), op(o), tid(ti) { } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -44,5 +44,6 @@ struct ETableClient : public LogEvent { //void update_segment(); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(ETableClient) #endif diff --git a/src/mds/events/ETableServer.h b/src/mds/events/ETableServer.h index 826d09726293..196905ad17f6 100644 --- a/src/mds/events/ETableServer.h +++ b/src/mds/events/ETableServer.h @@ -36,7 +36,7 @@ struct ETableServer : public LogEvent { LogEvent(EVENT_TABLESERVER), table(t), op(o), reqid(ri), bymds(m), tid(ti), version(v) { } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -54,5 +54,6 @@ struct ETableServer : public LogEvent { void update_segment(); void replay(MDSRank *mds); }; +WRITE_CLASS_ENCODER_FEATURES(ETableServer) #endif diff --git a/src/mds/events/EUpdate.h b/src/mds/events/EUpdate.h index 672af2735706..7d567e22e763 100644 --- a/src/mds/events/EUpdate.h +++ b/src/mds/events/EUpdate.h @@ -40,7 +40,7 @@ public: EMetaBlob *get_metablob() { return &metablob; } - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& ls); @@ -49,5 +49,6 @@ public: void replay(MDSRank *mds); EMetaBlob const *get_metablob() const {return &metablob;} }; +WRITE_CLASS_ENCODER_FEATURES(EUpdate) #endif diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 406a929ac544..55a4a89d121d 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -400,7 +400,7 @@ void EMetaBlob::update_segment(LogSegment *ls) // EMetaBlob::fullbit -void EMetaBlob::fullbit::encode(bufferlist& bl) const { +void EMetaBlob::fullbit::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(8, 5, bl); ::encode(dn, bl); ::encode(dnfirst, bl); @@ -419,7 +419,7 @@ void EMetaBlob::fullbit::encode(bufferlist& bl) const { ::encode(false, bl); } else { ::encode(true, bl); - ::encode(old_inodes, bl); + ::encode(old_inodes, bl, features); } if (!inode.is_dir()) ::encode(snapbl, bl); @@ -677,7 +677,7 @@ void EMetaBlob::nullbit::generate_test_instances(list& ls) // EMetaBlob::dirlump -void EMetaBlob::dirlump::encode(bufferlist& bl) const +void EMetaBlob::dirlump::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(2, 2, bl); ::encode(fnode, bl); @@ -685,7 +685,7 @@ void EMetaBlob::dirlump::encode(bufferlist& bl) const ::encode(nfull, bl); ::encode(nremote, bl); ::encode(nnull, bl); - _encode_bits(); + _encode_bits(features); ::encode(dnbl, bl); ENCODE_FINISH(bl); } @@ -751,12 +751,12 @@ void EMetaBlob::dirlump::generate_test_instances(list& ls) /** * EMetaBlob proper */ -void EMetaBlob::encode(bufferlist& bl) const +void EMetaBlob::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(8, 5, bl); ::encode(lump_order, bl); - ::encode(lump_map, bl); - ::encode(roots, bl); + ::encode(lump_map, bl, features); + ::encode(roots, bl, features); ::encode(table_tids, bl); ::encode(opened_ino, bl); ::encode(allocated_ino, bl); @@ -1696,7 +1696,7 @@ void ESession::replay(MDSRank *mds) update_segment(); } -void ESession::encode(bufferlist &bl) const +void ESession::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(4, 3, bl); ::encode(stamp, bl); @@ -1748,7 +1748,7 @@ void ESession::generate_test_instances(list& ls) // ----------------------- // ESessions -void ESessions::encode(bufferlist &bl) const +void ESessions::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(1, 1, bl); ::encode(client_map, bl); @@ -1819,7 +1819,7 @@ void ESessions::replay(MDSRank *mds) // ----------------------- // ETableServer -void ETableServer::encode(bufferlist& bl) const +void ETableServer::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); @@ -1918,7 +1918,7 @@ void ETableServer::replay(MDSRank *mds) // --------------------- // ETableClient -void ETableClient::encode(bufferlist& bl) const +void ETableClient::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); @@ -2003,12 +2003,12 @@ void ESnap::replay(MDSRank *mds) // ----------------------- // EUpdate -void EUpdate::encode(bufferlist &bl) const +void EUpdate::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(4, 4, bl); ::encode(stamp, bl); ::encode(type, bl); - ::encode(metablob, bl); + ::encode(metablob, bl, features); ::encode(client_map, bl); ::encode(cmapv, bl); ::encode(reqid, bl); @@ -2094,10 +2094,10 @@ void EUpdate::replay(MDSRank *mds) // ------------------------ // EOpen -void EOpen::encode(bufferlist &bl) const { +void EOpen::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); - ::encode(metablob, bl); + ::encode(metablob, bl, features); ::encode(inos, bl); ENCODE_FINISH(bl); } @@ -2169,7 +2169,7 @@ void ECommitted::replay(MDSRank *mds) } } -void ECommitted::encode(bufferlist& bl) const +void ECommitted::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); @@ -2380,7 +2380,7 @@ void rename_rollback::generate_test_instances(list& ls) ls.back()->stray.remote_d_type = IFTODT(S_IFREG); } -void ESlaveUpdate::encode(bufferlist &bl) const +void ESlaveUpdate::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); @@ -2389,7 +2389,7 @@ void ESlaveUpdate::encode(bufferlist &bl) const ::encode(master, bl); ::encode(op, bl); ::encode(origop, bl); - ::encode(commit, bl); + ::encode(commit, bl, features); ::encode(rollback, bl); ENCODE_FINISH(bl); } @@ -2472,11 +2472,11 @@ void ESlaveUpdate::replay(MDSRank *mds) // ----------------------- // ESubtreeMap -void ESubtreeMap::encode(bufferlist& bl) const +void ESubtreeMap::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(6, 5, bl); ::encode(stamp, bl); - ::encode(metablob, bl); + ::encode(metablob, bl, features); ::encode(subtrees, bl); ::encode(ambiguous_subtrees, bl); ::encode(expire_pos, bl); @@ -2716,14 +2716,14 @@ void EFragment::replay(MDSRank *mds) in->verify_dirfrags(); } -void EFragment::encode(bufferlist &bl) const { +void EFragment::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(5, 4, bl); ::encode(stamp, bl); ::encode(op, bl); ::encode(ino, bl); ::encode(basefrag, bl); ::encode(bits, bl); - ::encode(metablob, bl); + ::encode(metablob, bl, features); ::encode(orig_frags, bl); ::encode(rollback, bl); ENCODE_FINISH(bl); @@ -2812,11 +2812,11 @@ void EExport::replay(MDSRank *mds) mds->mdcache->try_trim_non_auth_subtree(dir); } -void EExport::encode(bufferlist& bl) const +void EExport::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); - ::encode(metablob, bl); + ::encode(metablob, bl, features); ::encode(base, bl); ::encode(bounds, bl); ENCODE_FINISH(bl); @@ -2907,11 +2907,11 @@ void EImportStart::replay(MDSRank *mds) update_segment(); } -void EImportStart::encode(bufferlist &bl) const { +void EImportStart::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); ::encode(base, bl); - ::encode(metablob, bl); + ::encode(metablob, bl, features); ::encode(bounds, bl); ::encode(cmapv, bl); ::encode(client_map, bl); @@ -2975,7 +2975,7 @@ void EImportFinish::replay(MDSRank *mds) } } -void EImportFinish::encode(bufferlist& bl) const +void EImportFinish::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(3, 3, bl); ::encode(stamp, bl); @@ -3010,7 +3010,7 @@ void EImportFinish::generate_test_instances(list& ls) // ------------------------ // EResetJournal -void EResetJournal::encode(bufferlist& bl) const +void EResetJournal::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(2, 2, bl); ::encode(stamp, bl); @@ -3055,7 +3055,7 @@ void EResetJournal::replay(MDSRank *mds) } -void ENoOp::encode(bufferlist &bl) const +void ENoOp::encode(bufferlist &bl, uint64_t features) const { ENCODE_START(2, 2, bl); ::encode(pad_size, bl); diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h index 2668f0b01408..0815c14a56b2 100644 --- a/src/test/encoding/types.h +++ b/src/test/encoding/types.h @@ -203,43 +203,43 @@ TYPE(InoTable) TYPE_STRAYDATA(SnapServer) #include "mds/events/ECommitted.h" -TYPE(ECommitted) +TYPE_FEATUREFUL(ECommitted) #include "mds/events/EExport.h" -TYPE(EExport) +TYPE_FEATUREFUL(EExport) #include "mds/events/EFragment.h" -TYPE(EFragment) +TYPE_FEATUREFUL(EFragment) #include "mds/events/EImportFinish.h" -TYPE(EImportFinish) +TYPE_FEATUREFUL(EImportFinish) #include "mds/events/EImportStart.h" -TYPE(EImportStart) +TYPE_FEATUREFUL(EImportStart) #include "mds/events/EMetaBlob.h" -TYPE_NOCOPY(EMetaBlob::fullbit) +TYPE_FEATUREFUL_NOCOPY(EMetaBlob::fullbit) TYPE(EMetaBlob::remotebit) TYPE(EMetaBlob::nullbit) -TYPE(EMetaBlob::dirlump) -TYPE(EMetaBlob) +TYPE_FEATUREFUL(EMetaBlob::dirlump) +TYPE_FEATUREFUL(EMetaBlob) #include "mds/events/EOpen.h" -TYPE(EOpen) +TYPE_FEATUREFUL(EOpen) #include "mds/events/EResetJournal.h" -TYPE(EResetJournal) +TYPE_FEATUREFUL(EResetJournal) #include "mds/events/ESession.h" -TYPE(ESession) +TYPE_FEATUREFUL(ESession) #include "mds/events/ESessions.h" -TYPE(ESessions) +TYPE_FEATUREFUL(ESessions) #include "mds/events/ESlaveUpdate.h" TYPE(link_rollback) TYPE(rmdir_rollback) TYPE(rename_rollback::drec) TYPE(rename_rollback) -TYPE(ESlaveUpdate) +TYPE_FEATUREFUL(ESlaveUpdate) #include "mds/events/ESubtreeMap.h" -TYPE(ESubtreeMap) +TYPE_FEATUREFUL(ESubtreeMap) #include "mds/events/ETableClient.h" -TYPE(ETableClient) +TYPE_FEATUREFUL(ETableClient) #include "mds/events/ETableServer.h" -TYPE(ETableServer) +TYPE_FEATUREFUL(ETableServer) #include "mds/events/EUpdate.h" -TYPE(EUpdate) +TYPE_FEATUREFUL(EUpdate) #ifdef WITH_RBD #include "librbd/journal/Types.h" diff --git a/src/tools/cephfs/EventOutput.cc b/src/tools/cephfs/EventOutput.cc index a93c099a918d..52eddba4879a 100644 --- a/src/tools/cephfs/EventOutput.cc +++ b/src/tools/cephfs/EventOutput.cc @@ -36,7 +36,7 @@ int EventOutput::binary() const for (JournalScanner::EventMap::const_iterator i = scan.events.begin(); i != scan.events.end(); ++i) { LogEvent *le = i->second.log_event; bufferlist le_bin; - le->encode(le_bin); + le->encode(le_bin, CEPH_FEATURES_SUPPORTED_DEFAULT); std::stringstream filename; filename << "0x" << std::hex << i->first << std::dec << "_" << le->get_type_str() << ".bin"; diff --git a/src/tools/cephfs/JournalTool.cc b/src/tools/cephfs/JournalTool.cc index d07d48743e2d..43ba9d354372 100644 --- a/src/tools/cephfs/JournalTool.cc +++ b/src/tools/cephfs/JournalTool.cc @@ -1095,7 +1095,7 @@ int JournalTool::erase_region(JournalScanner const &js, uint64_t const pos, uint // is needed inside the ENoOp to make up the difference. bufferlist tmp; ENoOp enoop(0); - enoop.encode_with_header(tmp); + enoop.encode_with_header(tmp, CEPH_FEATURES_SUPPORTED_DEFAULT); dout(4) << "erase_region " << pos << " len=" << length << dendl; @@ -1111,7 +1111,7 @@ int JournalTool::erase_region(JournalScanner const &js, uint64_t const pos, uint // Serialize an ENoOp with the correct amount of padding enoop = ENoOp(padding); bufferlist entry; - enoop.encode_with_header(entry); + enoop.encode_with_header(entry, CEPH_FEATURES_SUPPORTED_DEFAULT); JournalStream stream(JOURNAL_FORMAT_RESILIENT); // Serialize region of log stream diff --git a/src/tools/cephfs/Resetter.cc b/src/tools/cephfs/Resetter.cc index 6beaf98d5899..78f20cdd177e 100644 --- a/src/tools/cephfs/Resetter.cc +++ b/src/tools/cephfs/Resetter.cc @@ -161,7 +161,7 @@ int Resetter::_write_reset_event(Journaler *journaler) LogEvent *le = new EResetJournal; bufferlist bl; - le->encode_with_header(bl); + le->encode_with_header(bl, CEPH_FEATURES_SUPPORTED_DEFAULT); cout << "writing EResetJournal entry" << std::endl; C_SaferCond cond; -- 2.47.3