Repository navigation
crimson/os/seastore: fix laddr_t formatter and its use - #69476
Conversation
| @@ -3652,6 +3652,42 @@ template <> struct fmt::formatter<crimson::os::seastore::omap_type_t> : fmt::ost | |||
| template <> struct fmt::formatter<ceph::buffer::list> : fmt::ostream_formatter {}; | |||
| #endif | |||
|
|
|||
| namespace fmt { | |||
| template <> | |||
| struct fmt::formatter<crimson::os::seastore::laddr_t> { | |||
There was a problem hiding this comment.
this is not quite right. we either add formatter<crimson::os::seastore::laddr_t> in the fmt namespace, like:
namespace fmt {
template <> struct formatter<X> {
/// ...
};or just define it with the qualified-id in the global scope, like:
template <> struct fmt::formatter<X> {
/// ...
};but we should not do both. clang might accept it with -Wextra-qualification. but GCC should reject it extra qualification not allowed.
There was a problem hiding this comment.
Of course. Thank you. Skipped that when I was adding the 'namespace'
| @@ -1442,7 +1442,7 @@ ObjectDataHandler::clear_ret ObjectDataHandler::trim_data_reservation( | |||
| context_t ctx, object_data_t &object_data, extent_len_t size) | |||
| { | |||
| LOG_PREFIX(ObjectDataHandler::trim_data_reservation); | |||
| DEBUGT("0x{:x}~0x{:x}, 0x{:x}", | |||
| DEBUGT("0x{:x}~0x{}, 0x{:x}", | |||
There was a problem hiding this comment.
so, in this change, we added a specialization for crimson::os::seastore::laddr_t, which is the return value's type of object_data.get_reserved_data_base(), so we should change the above line to
DEBUGT("{}~0x{:x}, 0x{:x}",There was a problem hiding this comment.
Yes - I've miscounted the arguments
'laddr_t' existing formatter did not support a ':x' format specifier (actually - the output was always hexadecomal). Here we remove the ':x', but also refactor the custom formatter to avoid using the streambuf mechanism. Note - SEASTORE_LADDR_USE_BOOST_U128 is no longer supported by the formatter. Fixes: https://tracker.ceph.com/issues/77399 Signed-off-by: Ronen Friedman <[email protected]>
1147d68 to
620d936
Compare
|
jenkins test make check arm64 |
1 similar comment
|
jenkins test make check arm64 |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
'laddr_t' existing formatter did not support a ':x' format specifier (actually - the output was always hexadecomal).
Here we remove the ':x', but also refactor the custom formatter to avoid using the streambuf mechanism.
Note - SEASTORE_LADDR_USE_BOOST_U128 is no longer supported by the formatter.
Fixes: https://tracker.ceph.com/issues/77399