From: Shengjing Zhu Date: Fri, 14 Jan 2022 09:50:50 +0000 (+0000) Subject: Fix build with fmtlib 8.1.1 X-Git-Tag: archive/raspbian/16.2.7+ds-4+rpi1~2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=35a42867e677a67b15d1d93b70969c496eba69e3;p=ceph.git Fix build with fmtlib 8.1.1 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 --- diff --git a/src/crimson/os/seastore/CMakeLists.txt b/src/crimson/os/seastore/CMakeLists.txt index 77f8465cf..c6d4e937a 100644 --- 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 diff --git 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 index 94782f50d..3c45861ff 100644 --- 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 @@ class DeltaRecorderT final: public DeltaRecorder { } default: logger().error("OTree::Extent::Replay: got unknown op {} when replay {:#x}", - op, node.get_laddr()); + static_cast(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 index 000000000..d4a71324b --- /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!"; + } + } +} diff --git a/src/crimson/os/seastore/segment_manager.h b/src/crimson/os/seastore/segment_manager.h index 61c6509d1..30bdbc445 100644 --- a/src/crimson/os/seastore/segment_manager.h +++ b/src/crimson/os/seastore/segment_manager.h @@ -73,6 +73,9 @@ public: virtual ~Segment() {} }; + +std::ostream& operator<<(std::ostream& out, Segment::segment_state_t); + using SegmentRef = boost::intrusive_ptr; constexpr size_t PADDR_SIZE = sizeof(paddr_t);