]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson: specialize fmt::formatter<> for formatting using {fmt}
authorKefu Chai <tchaikov@gmail.com>
Fri, 25 Nov 2022 08:57:19 +0000 (16:57 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 25 Nov 2022 09:09:25 +0000 (17:09 +0800)
so the specialized types can be formatted using {fmt} v9.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/crimson/os/seastore/journal/circular_bounded_journal.h
src/crimson/os/seastore/object_data_handler.cc
src/crimson/os/seastore/onode.h
src/crimson/os/seastore/random_block_manager.h
src/crimson/os/seastore/seastore_types.h
src/test/crimson/seastore/onode_tree/test_value.h

index 2977872a5e749777d872163a3b1385887778d9b0..e6e20cca14710ea0293d7b2ea767e9d176aa0a60 100644 (file)
@@ -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<crimson::os::seastore::journal::CircularBoundedJournal::cbj_header_t> : fmt::ostream_formatter {};
+#endif
index 1f1ac4c939e8d8380d8bb72b2318960f7642efa7..5f839ef6fd5e0182c4fb8f3fb8ae9a26f893c59b 100644 (file)
@@ -359,6 +359,13 @@ struct overwrite_plan_t {
     }
   }
 };
+} // namespace namespace crimson::os::seastore {
+
+#if FMT_VERSION >= 90000
+template<> struct fmt::formatter<crimson::os::seastore::overwrite_plan_t> : fmt::ostream_formatter {};
+#endif
+
+namespace crimson::os::seastore {
 
 overwrite_plan_t generate_overwrite_plan(
   laddr_t offset,
index 0d8be372776ae2836cba84f1f9e98b741e38dea2..952dd9cca34d11f471a054ebed502f00877f18bc 100644 (file)
@@ -82,3 +82,7 @@ public:
 std::ostream& operator<<(std::ostream &out, const Onode &rhs);
 using OnodeRef = boost::intrusive_ptr<Onode>;
 }
+
+#if FMT_VERSION >= 90000
+template<> struct fmt::formatter<crimson::os::seastore::Onode> : fmt::ostream_formatter {};
+#endif
index 88d1be3707d0efcdb10da62c27eb56b2d4b04dfe..67cdc71339c10a89d0c4dc2cc41e38cc16d2159d 100644 (file)
@@ -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<crimson::os::seastore::rbm_metadata_header_t> : fmt::ostream_formatter {};
+#endif
index 5fe66e81c1bf405d66b6f1e8aee7b156e6e40b95..761577ec85c9b195733bc6a6cbdf53a21721aa4a 100644 (file)
@@ -2187,19 +2187,24 @@ template <> struct fmt::formatter<crimson::os::seastore::extent_types_t> : fmt::
 template <> struct fmt::formatter<crimson::os::seastore::journal_seq_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::journal_tail_delta_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::laddr_list_t> : fmt::ostream_formatter {};
+template <> struct fmt::formatter<crimson::os::seastore::omap_root_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::paddr_list_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::paddr_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::placement_hint_t> : fmt::ostream_formatter {};
+template <> struct fmt::formatter<crimson::os::seastore::record_group_header_t> : fmt::ostream_formatter {};
+template <> struct fmt::formatter<crimson::os::seastore::record_group_size_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::record_header_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::record_locator_t> : fmt::ostream_formatter {};
+template <> struct fmt::formatter<crimson::os::seastore::record_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::rewrite_gen_printer_t> : fmt::ostream_formatter {};
+template <> struct fmt::formatter<crimson::os::seastore::scan_valid_records_cursor> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::sea_time_point_printer_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::segment_header_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::segment_id_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::segment_seq_printer_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::segment_tail_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::segment_type_t> : fmt::ostream_formatter {};
-template <> struct fmt::formatter<crimson::os::seastore::omap_root_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<crimson::os::seastore::transaction_type_t> : fmt::ostream_formatter {};
+template <> struct fmt::formatter<crimson::os::seastore::write_result_t> : fmt::ostream_formatter {};
 template <> struct fmt::formatter<ceph::buffer::list> : fmt::ostream_formatter {};
 #endif
index 83a500e5dd64aa70ef047dcd3229e56896d9f71f..bf58ede6bd45c3af3865edeff5c1244731915e0d 100644 (file)
@@ -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<crimson::os::seastore::onode::delta_op_t> : fmt::ostream_formatter {};
+#endif
+
+namespace crimson::os::seastore::onode {
+
 template <value_magic_t MAGIC,
           string_size_t MAX_NS_SIZE,
           string_size_t MAX_OID_SIZE,