From: John Spray Date: Thu, 25 Jun 2015 08:47:46 +0000 (+0100) Subject: mds: add a ceph_file_layout wrapper for dencoder X-Git-Tag: v9.0.3~105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5070%2Fhead;p=ceph.git mds: add a ceph_file_layout wrapper for dencoder So that we can decode it from tests. This should go away at some point when encoding of these raw-encoded structures is modernized. Signed-off-by: John Spray --- diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc index 55257644da9e..370b11671e97 100644 --- a/src/mds/mdstypes.cc +++ b/src/mds/mdstypes.cc @@ -1078,3 +1078,9 @@ void MDSCacheObject::dump_states(Formatter *f) const if (state_test(STATE_REJOINUNDEF)) f->dump_string("state", "rejoinundef"); } + +void ceph_file_layout_wrapper::dump(Formatter *f) const +{ + ::dump(static_cast(*this), f); +} + diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 0bffe4bec9b6..55fd69eeb268 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -1577,7 +1577,25 @@ inline std::ostream& operator<<(std::ostream& out, mdsco_db_line_prefix o) { return out; } +class ceph_file_layout_wrapper : public ceph_file_layout +{ +public: + void encode(bufferlist &bl) const + { + ::encode(static_cast(*this), bl); + } + + void decode(bufferlist::iterator &p) + { + ::decode(static_cast(*this), p); + } + + static void generate_test_instances(std::list& ls) + { + } + void dump(Formatter *f) const; +}; diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h index cb06b15f32e8..dccce4bdc583 100644 --- a/src/test/encoding/types.h +++ b/src/test/encoding/types.h @@ -169,6 +169,7 @@ TYPE(cap_reconnect_t) TYPE(inode_backtrace_t) TYPE(inode_backpointer_t) TYPE(quota_info_t) +TYPE(ceph_file_layout_wrapper) #include "mds/CInode.h" TYPE(InodeStore)