]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add a ceph_file_layout wrapper for dencoder 5070/head
authorJohn Spray <john.spray@redhat.com>
Thu, 25 Jun 2015 08:47:46 +0000 (09:47 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 25 Jun 2015 13:47:13 +0000 (14:47 +0100)
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 <john.spray@redhat.com>
src/mds/mdstypes.cc
src/mds/mdstypes.h
src/test/encoding/types.h

index 55257644da9e444e63396735487ec0bcd1bef846..370b11671e97a02ad3b65044620d8143ac3d909a 100644 (file)
@@ -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<const ceph_file_layout&>(*this), f);
+}
+
index 0bffe4bec9b62dbadb3cdf526b12ed79b067e903..55fd69eeb26898004c9d687575abd8ad9568e190 100644 (file)
@@ -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<const ceph_file_layout&>(*this), bl);
+  }
+
+  void decode(bufferlist::iterator &p)
+  {
+    ::decode(static_cast<ceph_file_layout&>(*this), p);
+  }
+
+  static void generate_test_instances(std::list<ceph_file_layout_wrapper*>& ls)
+  {
+  }
 
+  void dump(Formatter *f) const;
+};
 
 
 
index cb06b15f32e808f1cdf098dffdc7a4b3b4936e8e..dccce4bdc583dd4ad09ad46cb8d8cf7e9eb75974 100644 (file)
@@ -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)