From: Kefu Chai Date: Fri, 25 Nov 2022 08:57:19 +0000 (+0800) Subject: crimson: specialize fmt::formatter<> for formatting using {fmt} X-Git-Tag: v18.1.0~810^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85830863fa4419f9a49db26773baf4c31dafda4c;p=ceph.git crimson: specialize fmt::formatter<> for formatting using {fmt} so the specialized types can be formatted using {fmt} v9. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/os/seastore/journal/circular_bounded_journal.h b/src/crimson/os/seastore/journal/circular_bounded_journal.h index 2977872a5e74..e6e20cca1471 100644 --- a/src/crimson/os/seastore/journal/circular_bounded_journal.h +++ b/src/crimson/os/seastore/journal/circular_bounded_journal.h @@ -313,3 +313,7 @@ std::ostream &operator<<(std::ostream &out, const CircularBoundedJournal::cbj_he } WRITE_CLASS_DENC_BOUNDED(crimson::os::seastore::journal::CircularBoundedJournal::cbj_header_t) + +#if FMT_VERSION >= 90000 +template <> struct fmt::formatter : fmt::ostream_formatter {}; +#endif diff --git a/src/crimson/os/seastore/object_data_handler.cc b/src/crimson/os/seastore/object_data_handler.cc index 1f1ac4c939e8..5f839ef6fd5e 100644 --- a/src/crimson/os/seastore/object_data_handler.cc +++ b/src/crimson/os/seastore/object_data_handler.cc @@ -359,6 +359,13 @@ struct overwrite_plan_t { } } }; +} // namespace namespace crimson::os::seastore { + +#if FMT_VERSION >= 90000 +template<> struct fmt::formatter : fmt::ostream_formatter {}; +#endif + +namespace crimson::os::seastore { overwrite_plan_t generate_overwrite_plan( laddr_t offset, diff --git a/src/crimson/os/seastore/onode.h b/src/crimson/os/seastore/onode.h index 0d8be372776a..952dd9cca34d 100644 --- a/src/crimson/os/seastore/onode.h +++ b/src/crimson/os/seastore/onode.h @@ -82,3 +82,7 @@ public: std::ostream& operator<<(std::ostream &out, const Onode &rhs); using OnodeRef = boost::intrusive_ptr; } + +#if FMT_VERSION >= 90000 +template<> struct fmt::formatter : fmt::ostream_formatter {}; +#endif diff --git a/src/crimson/os/seastore/random_block_manager.h b/src/crimson/os/seastore/random_block_manager.h index 88d1be3707d0..67cdc71339c1 100644 --- a/src/crimson/os/seastore/random_block_manager.h +++ b/src/crimson/os/seastore/random_block_manager.h @@ -122,3 +122,7 @@ std::ostream &operator<<(std::ostream &out, const rbm_metadata_header_t &header) WRITE_CLASS_DENC_BOUNDED( crimson::os::seastore::rbm_metadata_header_t ) + +#if FMT_VERSION >= 90000 +template<> struct fmt::formatter : fmt::ostream_formatter {}; +#endif diff --git a/src/crimson/os/seastore/seastore_types.h b/src/crimson/os/seastore/seastore_types.h index 5fe66e81c1bf..761577ec85c9 100644 --- a/src/crimson/os/seastore/seastore_types.h +++ b/src/crimson/os/seastore/seastore_types.h @@ -2187,19 +2187,24 @@ template <> struct fmt::formatter : fmt:: template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; +template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; +template <> struct fmt::formatter : fmt::ostream_formatter {}; +template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; +template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; +template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; -template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; +template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; #endif diff --git a/src/test/crimson/seastore/onode_tree/test_value.h b/src/test/crimson/seastore/onode_tree/test_value.h index 83a500e5dd64..bf58ede6bd45 100644 --- a/src/test/crimson/seastore/onode_tree/test_value.h +++ b/src/test/crimson/seastore/onode_tree/test_value.h @@ -54,6 +54,14 @@ inline std::ostream& operator<<(std::ostream& os, const delta_op_t op) { } } +} // namespace crimson::os::seastore::onode + +#if FMT_VERSION >= 90000 +template<> struct fmt::formatter : fmt::ostream_formatter {}; +#endif + +namespace crimson::os::seastore::onode { + template