From: Matan Breizman Date: Mon, 6 Jan 2025 18:43:10 +0000 (+0000) Subject: crimson/common/tri_mutex: use string for tri_mutex::name debug X-Git-Tag: v20.0.0~337^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0e027d535b1767f85c00b67b995be2fc0d36b38e;p=ceph.git crimson/common/tri_mutex: use string for tri_mutex::name debug This partially reverts 822c7d96161f47a1f760e22cee2df08bd52a4e2e. As passing hobject::to_str instead of hoid.oid.name will also include snap info. Signed-off-by: Matan Breizman --- diff --git a/src/crimson/common/tri_mutex.h b/src/crimson/common/tri_mutex.h index f920235bea58f..7cdc71b7eaa0c 100644 --- a/src/crimson/common/tri_mutex.h +++ b/src/crimson/common/tri_mutex.h @@ -6,7 +6,6 @@ #include #include -#include "common/hobject.h" #include "crimson/common/log.h" class read_lock { @@ -47,9 +46,10 @@ class tri_mutex : private read_lock, public: tri_mutex() = default; #ifdef NDEBUG - tri_mutex(const hobject_t &obj_name) : name() {} + tri_mutex(const std::string &obj_str) : name() {} #else - tri_mutex(const hobject_t &obj_name) : name(obj_name) {} + tri_mutex(const std::string &obj_str) : name(obj_str) { + } #endif ~tri_mutex(); @@ -101,8 +101,8 @@ public: } } - std::string get_name() const{ - return name.to_str(); + std::string_view get_name() const{ + return name; } private: @@ -124,7 +124,7 @@ private: type_t type; }; seastar::circular_buffer waiters; - const hobject_t name; + const std::string name; friend class read_lock; friend class write_lock; friend class excl_lock; diff --git a/src/crimson/osd/object_context.h b/src/crimson/osd/object_context.h index 83037889bedbf..56e04ac02d6b1 100644 --- a/src/crimson/osd/object_context.h +++ b/src/crimson/osd/object_context.h @@ -76,7 +76,7 @@ public: CommonOBCPipeline obc_pipeline; - ObjectContext(hobject_t hoid) : lock(hoid), + ObjectContext(hobject_t hoid) : lock(hoid.to_str()), obs(std::move(hoid)) {} void update_from(