]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/tri_mutex: avoid hobject_t formatting 58905/head
authorMatan Breizman <mbreizma@redhat.com>
Sun, 28 Jul 2024 14:49:27 +0000 (17:49 +0300)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 13 Aug 2024 12:44:23 +0000 (12:44 +0000)
```
/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<T> 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<fmt::basic_format_context<fmt::appender, char>, const hobject_t &>' requested here
  return make_value<Context>(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<true, fmt::basic_format_context<fmt::appender, char>, 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<fmt::basic_format_context<fmt::appender, char>, hobject_t, unsigned int, unsigned int, bool, unsigned long>::format_arg_store<const hobject_t &, unsigned int &, unsigned int &, const bool &, unsigned long &>' 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<fmt::basic_format_context<fmt::appender, char>, 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<const hobject_t &, unsigned int, unsigned int, const bool &, unsigned long>' requested here
  os << fmt::format("tri_mutex {} writers {} readers {}"
             ^
```

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit 1251345231fc96150bdab73059eb060de7c8f615)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/common/tri_mutex.h

index ae7119985bff4302a23eff6191fade680085647e..04d156183f6ac718062ec72b62dd6b652712e832 100644 (file)
@@ -101,8 +101,8 @@ public:
     }
   }
 
-  const hobject_t &get_name() const{
-    return name;
+  std::string get_name() const{
+    return name.to_str();
   }
 
 private: