Control: tags -1 patch

Please see the patch in attachment.

Thanks.
Description: Fix build with fmtlib 8.1.1
 + 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.
Author: Shengjing Zhu <z...@debian.org>
Bug: https://tracker.ceph.com/issues/53820
Bug-Debian: https://bugs.debian.org/1003469
Forwarded: no
Last-Update: 2022-01-14
---
--- a/src/crimson/os/seastore/CMakeLists.txt
+++ b/src/crimson/os/seastore/CMakeLists.txt
@@ -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
--- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_accessor.h
+++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_accessor.h
@@ -169,7 +169,7 @@
       }
       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) {
--- /dev/null
+++ b/src/crimson/os/seastore/segment_manager.cc
@@ -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!";
+    }
+  }
+}
--- a/src/crimson/os/seastore/segment_manager.h
+++ b/src/crimson/os/seastore/segment_manager.h
@@ -73,6 +73,9 @@
 
   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);

Reply via email to