From fc635888226a14fabe3979c1da761be68c955ff9 Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Thu, 6 Jul 2023 06:18:55 -0500 Subject: [PATCH] osd/osd_types_fmt: mark fmt::formatter<>::format() const For some formatters missed or added after PR#47830 (that fixed most of the missing 'const's in this file) Required to allow the use of the formatters in const member functions. Signed-off-by: Ronen Friedman --- src/osd/osd_types_fmt.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/osd/osd_types_fmt.h b/src/osd/osd_types_fmt.h index 8d48134106e..65a751469f7 100644 --- a/src/osd/osd_types_fmt.h +++ b/src/osd/osd_types_fmt.h @@ -57,7 +57,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } template - auto format(const chunk_info_t& ci, FormatContext& ctx) + auto format(const chunk_info_t& ci, FormatContext& ctx) const { return fmt::format_to(ctx.out(), "(len: {} oid: {} offset: {} flags: {})", ci.length, ci.oid, ci.offset, @@ -169,7 +169,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } template - auto format(const pg_info_t& pgi, FormatContext& ctx) + auto format(const pg_info_t& pgi, FormatContext& ctx) const { fmt::format_to(ctx.out(), "{}({}", pgi.pgid, (pgi.dne() ? " DNE" : "")); if (pgi.is_empty()) { @@ -211,7 +211,7 @@ struct fmt::formatter { } template - auto format(const SnapSet& snps, FormatContext& ctx) + auto format(const SnapSet& snps, FormatContext& ctx) const { if (verbose) { // similar to SnapSet::dump() @@ -265,7 +265,7 @@ struct fmt::formatter { ///\todo: consider passing the 'D" flag to control snapset dump template - auto format(const ScrubMap::object& so, FormatContext& ctx) + auto format(const ScrubMap::object& so, FormatContext& ctx) const { fmt::format_to(ctx.out(), "so{{ sz:{} dd:{} od:{} ", @@ -308,7 +308,7 @@ struct fmt::formatter { } template - auto format(const ScrubMap& smap, FormatContext& ctx) + auto format(const ScrubMap& smap, FormatContext& ctx) const { fmt::format_to(ctx.out(), "smap{{ valid:{} incr-since:{} #:{}", -- 2.47.3