summarylogtreecommitdiffstats
path: root/ceph-18.2.4-fmt-formatter-const.patch
blob: 2dff29fac3599685fa660882f3c512dc2355250a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
diff --git a/src/common/hobject_fmt.h b/src/common/hobject_fmt.h
index 622611121ae..c69495d1fa1 100644
--- a/src/common/hobject_fmt.h
+++ b/src/common/hobject_fmt.h
@@ -30,7 +30,7 @@ template <> struct fmt::formatter<hobject_t> {
 
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
-  template <typename FormatContext> auto format(const hobject_t& ho, FormatContext& ctx)
+  template <typename FormatContext> auto format(const hobject_t& ho, FormatContext& ctx) const
   {
     if (ho == hobject_t{}) {
       return fmt::format_to(ctx.out(), "MIN");
diff --git a/src/crimson/common/formatter.cc b/src/crimson/common/formatter.cc
index ab371ddbfce..9ced61d9848 100644
--- a/src/crimson/common/formatter.cc
+++ b/src/crimson/common/formatter.cc
@@ -19,7 +19,7 @@ struct fmt::formatter<seastar::lowres_system_clock::time_point> {
 
   template <typename FormatContext>
   auto format(const seastar::lowres_system_clock::time_point& t,
-              FormatContext& ctx) {
+              FormatContext& ctx) const {
     std::time_t tt = std::chrono::duration_cast<std::chrono::seconds>(
       t.time_since_epoch()).count();
     auto milliseconds = (t.time_since_epoch() %
diff --git a/src/crimson/net/io_handler.h b/src/crimson/net/io_handler.h
index f53c2ba6468..02b0edd5bca 100644
--- a/src/crimson/net/io_handler.h
+++ b/src/crimson/net/io_handler.h
@@ -580,7 +580,7 @@ struct fmt::formatter<crimson::net::io_handler_state> {
   }
 
   template <typename FormatContext>
-  auto format(crimson::net::io_handler_state state, FormatContext& ctx) {
+  auto format(crimson::net::io_handler_state state, FormatContext& ctx) const {
     return fmt::format_to(
         ctx.out(),
         "io(in_seq={}, is_out_queued={}, has_out_sent={})",
@@ -594,7 +594,7 @@ template <>
 struct fmt::formatter<crimson::net::IOHandler::io_state_t>
   : fmt::formatter<std::string_view> {
   template <typename FormatContext>
-  auto format(crimson::net::IOHandler::io_state_t state, FormatContext& ctx) {
+  auto format(crimson::net::IOHandler::io_state_t state, FormatContext& ctx) const {
     using enum crimson::net::IOHandler::io_state_t;
     std::string_view name;
     switch (state) {
diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h
index 22c140b5993..6acb1df0077 100644
--- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h
+++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h
@@ -115,7 +115,7 @@ template <> struct fmt::formatter<crimson::os::seastore::onode::node_delta_op_t>
   using node_delta_op_t =  crimson::os::seastore::onode::node_delta_op_t;
   // parse is inherited from formatter<string_view>.
   template <typename FormatContext>
-  auto format(node_delta_op_t op, FormatContext& ctx) {
+  auto format(node_delta_op_t op, FormatContext& ctx) const {
     std::string_view name = "unknown";
     switch (op) {
     case node_delta_op_t::INSERT:
diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h
index 7185b15eedc..a1dd202bf85 100644
--- a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h
+++ b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h
@@ -2482,7 +2482,7 @@ concept HasDoFormatTo = requires(T x, std::back_insert_iterator<fmt::memory_buff
 };
 template <HasDoFormatTo T> struct fmt::formatter<T> : fmt::formatter<std::string_view> {
   template <typename FormatContext>
-  auto format(const T& staged_iterator, FormatContext& ctx) {
+  auto format(const T& staged_iterator, FormatContext& ctx) const {
     return staged_iterator.do_format_to(ctx.out(), true);
   }
 };
diff --git a/src/crimson/os/seastore/seastore.cc b/src/crimson/os/seastore/seastore.cc
index 897a063e0fe..15e90ff6a5b 100644
--- a/src/crimson/os/seastore/seastore.cc
+++ b/src/crimson/os/seastore/seastore.cc
@@ -39,7 +39,7 @@ template <> struct fmt::formatter<crimson::os::seastore::op_type_t>
   using op_type_t =  crimson::os::seastore::op_type_t;
   // parse is inherited from formatter<string_view>.
   template <typename FormatContext>
-  auto format(op_type_t op, FormatContext& ctx) {
+  auto format(op_type_t op, FormatContext& ctx) const {
     std::string_view name = "unknown";
     switch (op) {
       case op_type_t::TRANSACTION:
diff --git a/src/crimson/os/seastore/segment_manager/block.cc b/src/crimson/os/seastore/segment_manager/block.cc
index 4eb8d60b21c..3ed0fbdef6d 100644
--- a/src/crimson/os/seastore/segment_manager/block.cc
+++ b/src/crimson/os/seastore/segment_manager/block.cc
@@ -33,7 +33,7 @@ using segment_state_t = crimson::os::seastore::Segment::segment_state_t;
 template <> struct fmt::formatter<segment_state_t>: fmt::formatter<std::string_view> {
   // parse is inherited from formatter<string_view>.
   template <typename FormatContext>
-  auto format(segment_state_t s, FormatContext& ctx) {
+  auto format(segment_state_t s, FormatContext& ctx) const {
     std::string_view name = "unknown";
     switch (s) {
     case segment_state_t::EMPTY:
diff --git a/src/crimson/os/seastore/segment_manager/zbd.cc b/src/crimson/os/seastore/segment_manager/zbd.cc
index 88521a947f8..08145cb5692 100644
--- a/src/crimson/os/seastore/segment_manager/zbd.cc
+++ b/src/crimson/os/seastore/segment_manager/zbd.cc
@@ -22,7 +22,7 @@ SET_SUBSYS(seastore_device);
 using z_op = crimson::os::seastore::segment_manager::zbd::zone_op;
 template <> struct fmt::formatter<z_op>: fmt::formatter<std::string_view> {
   template <typename FormatContext>
-  auto format(z_op s, FormatContext& ctx) {
+  auto format(z_op s, FormatContext& ctx) const {
     std::string_view name = "Unknown";
     switch (s) {
       using enum z_op;
diff --git a/src/include/utime_fmt.h b/src/include/utime_fmt.h
index e7a98d2097d..9d49d1bf050 100644
--- a/src/include/utime_fmt.h
+++ b/src/include/utime_fmt.h
@@ -23,7 +23,7 @@ struct fmt::formatter<utime_t> {
   }
 
   template <typename FormatContext>
-  auto format(const utime_t& utime, FormatContext& ctx)
+  auto format(const utime_t& utime, FormatContext& ctx) const
   {
     if (utime.sec() < ((time_t)(60 * 60 * 24 * 365 * 10))) {
       // raw seconds.  this looks like a relative time.
diff --git a/src/msg/msg_fmt.h b/src/msg/msg_fmt.h
index 41c4c6af89d..4c6c7d23026 100644
--- a/src/msg/msg_fmt.h
+++ b/src/msg/msg_fmt.h
@@ -15,7 +15,7 @@ struct fmt::formatter<entity_name_t> {
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  auto format(const entity_name_t& addr, FormatContext& ctx)
+  auto format(const entity_name_t& addr, FormatContext& ctx) const
   {
     if (addr.is_new() || addr.num() < 0) {
       return fmt::format_to(ctx.out(), "{}.?", addr.type_str());
diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h
index 6901ab5062b..8b41aa25f9c 100644
--- a/src/osd/PeeringState.h
+++ b/src/osd/PeeringState.h
@@ -64,7 +64,7 @@ struct fmt::formatter<PGPool> {
   constexpr auto parse(ParseContext& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  auto format(const PGPool& pool, FormatContext& ctx)
+  auto format(const PGPool& pool, FormatContext& ctx) const
   {
     return fmt::format_to(ctx.out(),
                           "{}/{}({})",
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<chunk_info_t> {
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  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<pg_info_t> {
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  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<SnapSet> {
   }
 
   template <typename FormatContext>
-  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<ScrubMap::object> {
 
   ///\todo: consider passing the 'D" flag to control snapset dump
   template <typename FormatContext>
-  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<ScrubMap> {
   }
 
   template <typename FormatContext>
-  auto format(const ScrubMap& smap, FormatContext& ctx)
+  auto format(const ScrubMap& smap, FormatContext& ctx) const
   {
     fmt::format_to(ctx.out(),
 		   "smap{{ valid:{} incr-since:{} #:{}",
diff --git a/src/osd/scrubber/osd_scrub_sched.h b/src/osd/scrubber/osd_scrub_sched.h
index 17cd0e49377..aa3c55c6c99 100644
--- a/src/osd/scrubber/osd_scrub_sched.h
+++ b/src/osd/scrubber/osd_scrub_sched.h
@@ -526,7 +526,7 @@ template <>
 struct fmt::formatter<ScrubQueue::qu_state_t>
     : fmt::formatter<std::string_view> {
   template <typename FormatContext>
-  auto format(const ScrubQueue::qu_state_t& s, FormatContext& ctx)
+  auto format(const ScrubQueue::qu_state_t& s, FormatContext& ctx) const
   {
     auto out = ctx.out();
     out = fmt::formatter<string_view>::format(
@@ -540,7 +540,7 @@ struct fmt::formatter<ScrubQueue::ScrubJob> {
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  auto format(const ScrubQueue::ScrubJob& sjob, FormatContext& ctx)
+  auto format(const ScrubQueue::ScrubJob& sjob, FormatContext& ctx) const
   {
     return fmt::format_to(
       ctx.out(),
diff --git a/src/osd/scrubber/scrub_backend.h b/src/osd/scrubber/scrub_backend.h
index ffb41c27e37..8d4e8182116 100644
--- a/src/osd/scrubber/scrub_backend.h
+++ b/src/osd/scrubber/scrub_backend.h
@@ -177,7 +177,7 @@ struct fmt::formatter<shard_as_auth_t> {
     return it;
   }
   template <typename FormatContext>
-  auto format(shard_as_auth_t const& as_auth, FormatContext& ctx)
+  auto format(shard_as_auth_t const& as_auth, FormatContext& ctx) const
   {
     if (debug_log) {
       // note: 'if' chain, as hard to consistently (on all compilers) avoid some
@@ -229,7 +229,7 @@ struct fmt::formatter<auth_selection_t> {
   }
 
   template <typename FormatContext>
-  auto format(auth_selection_t const& aus, FormatContext& ctx)
+  auto format(auth_selection_t const& aus, FormatContext& ctx) const
   {
     return fmt::format_to(ctx.out(),
                           " {{AU-S: {}->{:x} OI({:x}:{}) {} dm:{}}} ",
@@ -522,7 +522,7 @@ struct fmt::formatter<data_omap_digests_t> {
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  auto format(const data_omap_digests_t& dg, FormatContext& ctx)
+  auto format(const data_omap_digests_t& dg, FormatContext& ctx) const
   {
     // can't use value_or() due to different output types
     if (std::get<0>(dg).has_value()) {
diff --git a/src/osd/scrubber_common.h b/src/osd/scrubber_common.h
index a15ea65969f..7efc8e24f74 100644
--- a/src/osd/scrubber_common.h
+++ b/src/osd/scrubber_common.h
@@ -166,7 +166,7 @@ struct fmt::formatter<requested_scrub_t> {
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  auto format(const requested_scrub_t& rs, FormatContext& ctx)
+  auto format(const requested_scrub_t& rs, FormatContext& ctx) const
   {
     return fmt::format_to(ctx.out(),
                           "(plnd:{}{}{}{}{}{}{}{}{}{})",
diff --git a/src/test/osd/scrubber_generators.h b/src/test/osd/scrubber_generators.h
index d0cbb22c4c8..165488241c4 100644
--- a/src/test/osd/scrubber_generators.h
+++ b/src/test/osd/scrubber_generators.h
@@ -253,7 +253,7 @@ struct fmt::formatter<ScrubGenerator::RealObj> {
   constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
 
   template <typename FormatContext>
-  auto format(const ScrubGenerator::RealObj& rlo, FormatContext& ctx)
+  auto format(const ScrubGenerator::RealObj& rlo, FormatContext& ctx) const
   {
     using namespace ScrubGenerator;
     return fmt::format_to(ctx.out(),