Fix build with fmtlib 8.1.1
authorShengjing Zhu <zhsj@debian.org>
Fri, 15 Jul 2022 15:27:25 +0000 (16:27 +0100)
committerThomas Goirand <zigo@debian.org>
Fri, 15 Jul 2022 15:27:25 +0000 (16:27 +0100)
Bug: https://tracker.ceph.com/issues/53820
Bug-Debian: https://bugs.debian.org/1003469
Forwarded: no
Last-Update: 2022-01-14

+ changes in segment_manager.cc and segment_manager.h are backported from
  part of the large changes in https://github.com/ceph/ceph/commit/d5b0cd13
+ change in node_extent_accessor.h is not forwarded to upstream since it's
  a workaround. However it doesn't harm since it's just a error message
  which shouldn't happen anyway.

Gbp-Pq: Name fix-build-with-fmt-8.1.1.patch

src/crimson/os/seastore/CMakeLists.txt
src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_accessor.h
src/crimson/os/seastore/segment_manager.cc [new file with mode: 0644]
src/crimson/os/seastore/segment_manager.h

index 77f8465cf9a665bcf64dd815f8b957f6fbbf87d6..c6d4e937a370cef31c537af6a232a38a37944ddc 100644 (file)
@@ -1,6 +1,7 @@
 add_library(crimson-seastore STATIC
   cached_extent.cc
   seastore_types.cc
+  segment_manager.cc
   segment_manager/ephemeral.cc
   segment_manager/block.cc
   transaction_manager.cc
index 94782f50d4d9bbd4cf047290b8590152de076052..3c45861ff71d5e2f208464dbd4702a0ea881b4b4 100644 (file)
@@ -169,7 +169,7 @@ class DeltaRecorderT final: public DeltaRecorder {
       }
       default:
         logger().error("OTree::Extent::Replay: got unknown op {} when replay {:#x}",
-                       op, node.get_laddr());
+                       static_cast<uint8_t>(op), node.get_laddr());
         ceph_abort();
       }
     } catch (buffer::error& e) {
diff --git a/src/crimson/os/seastore/segment_manager.cc b/src/crimson/os/seastore/segment_manager.cc
new file mode 100644 (file)
index 0000000..d4a7132
--- /dev/null
@@ -0,0 +1,19 @@
+#include "crimson/os/seastore/segment_manager.h"
+
+namespace crimson::os::seastore {
+
+  std::ostream& operator<<(std::ostream &out, Segment::segment_state_t s)
+  {
+    using state_t = Segment::segment_state_t;
+    switch (s) {
+      case state_t::EMPTY:
+        return out << "EMPTY";
+      case state_t::OPEN:
+        return out << "OPEN";
+      case state_t::CLOSED:
+        return out << "CLOSED";
+      default:
+        return out << "INVALID_SEGMENT_STATE!";
+    }
+  }
+}
index 61c6509d19f7dbc503a262d4022b518775d792a0..30bdbc445b0d7e7560d8655b682702ef75dfa921 100644 (file)
@@ -73,6 +73,9 @@ public:
 
   virtual ~Segment() {}
 };
+
+std::ostream& operator<<(std::ostream& out, Segment::segment_state_t);
+
 using SegmentRef = boost::intrusive_ptr<Segment>;
 
 constexpr size_t PADDR_SIZE = sizeof(paddr_t);