From f762a57fd99f491cac01af3de78e87b8767b5e04 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Sun, 28 Jul 2024 17:49:27 +0300 Subject: [PATCH] crimson/common/tri_mutex: avoid hobject_t formatting ``` /home/jenkins-build/build/workspace/ceph-pull-requests/src/fmt/include/fmt/core.h:1756:3: error: static_assert failed due to requirement 'formattable' "Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt" static_assert( ^ /home/jenkins-build/build/workspace/ceph-pull-requests/src/fmt/include/fmt/core.h:1777:10: note: in instantiation of function template specialization 'fmt::detail::make_value, const hobject_t &>' requested here return make_value(val); ^ /home/jenkins-build/build/workspace/ceph-pull-requests/src/fmt/include/fmt/core.h:1899:23: note: in instantiation of function template specialization 'fmt::detail::make_arg, fmt::detail::type::custom_type, const hobject_t &, 0>' requested here data_{detail::make_arg< ^ /home/jenkins-build/build/workspace/ceph-pull-requests/src/fmt/include/fmt/core.h:1918:10: note: in instantiation of function template specialization 'fmt::format_arg_store, hobject_t, unsigned int, unsigned int, bool, unsigned long>::format_arg_store' requested here return {FMT_FORWARD(args)...}; ^ /home/jenkins-build/build/workspace/ceph-pull-requests/src/fmt/include/fmt/core.h:3206:28: note: in instantiation of function template specialization 'fmt::make_format_args, const hobject_t &, unsigned int &, unsigned int &, const bool &, unsigned long &>' requested here return vformat(fmt, fmt::make_format_args(args...)); ^ /home/jenkins-build/build/workspace/ceph-pull-requests/src/crimson/common/tri_mutex.h:136:14: note: in instantiation of function template specialization 'fmt::format' requested here os << fmt::format("tri_mutex {} writers {} readers {}" ^ ``` Signed-off-by: Matan Breizman (cherry picked from commit 1251345231fc96150bdab73059eb060de7c8f615) Signed-off-by: Matan Breizman --- src/crimson/common/tri_mutex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crimson/common/tri_mutex.h b/src/crimson/common/tri_mutex.h index ae7119985bf..04d156183f6 100644 --- a/src/crimson/common/tri_mutex.h +++ b/src/crimson/common/tri_mutex.h @@ -101,8 +101,8 @@ public: } } - const hobject_t &get_name() const{ - return name; + std::string get_name() const{ + return name.to_str(); } private: -- 2.39.5