From: Ronen Friedman Date: Thu, 6 Jul 2023 11:18:55 +0000 (-0500) Subject: osd/osd_types_fmt: mark fmt::formatter<>::format() const X-Git-Tag: v19.0.0~928^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F52337%2Fhead;p=ceph.git 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 --- 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:{} #:{}",