]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: add operator<< for file_layout_t
authorJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 11:42:36 +0000 (12:42 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 12:05:17 +0000 (13:05 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/common/fs_types.cc
src/include/fs_types.h

index 741e4f123310ca295778a1beaeccd54716132cc2..95e9b389a2eb77f1ee865d1838fff5970f0f3f70 100644 (file)
@@ -122,3 +122,12 @@ void file_layout_t::generate_test_instances(list<file_layout_t*>& o)
   o.back()->pool_id = 3;
   o.back()->pool_ns = "myns";
 }
+
+ostream& operator<<(ostream& out, const file_layout_t &layout)
+{
+  JSONFormatter f;
+  layout.dump(&f);
+  f.flush(out);
+  return out;
+}
+
index 388508b1d5e82b0cbeeac07d949ed48d292adb94..c9271cca05893907b4bf43c762af10f6a3d4e62f 100644 (file)
@@ -103,4 +103,6 @@ WRITE_CLASS_ENCODER_FEATURES(file_layout_t)
 
 WRITE_EQ_OPERATORS_5(file_layout_t, stripe_unit, stripe_count, object_size, pool_id, pool_ns);
 
+ostream& operator<<(ostream& out, const file_layout_t &layout);
+
 #endif