]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/tri_mutex: use string for tri_mutex::name debug 61253/head
authorMatan Breizman <mbreizma@redhat.com>
Mon, 6 Jan 2025 18:43:10 +0000 (18:43 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 8 Jan 2025 10:52:23 +0000 (10:52 +0000)
This partially reverts 822c7d96161f47a1f760e22cee2df08bd52a4e2e.
As passing hobject::to_str instead of hoid.oid.name will also include
snap info.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/common/tri_mutex.h
src/crimson/osd/object_context.h

index f920235bea58fa4f1d6a23fa818d3a4aad303685..7cdc71b7eaa0c2a362703711f5d1dd614376efa9 100644 (file)
@@ -6,7 +6,6 @@
 #include <seastar/core/future.hh>
 #include <seastar/core/circular_buffer.hh>
 
-#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<waiter_t> waiters;
-  const hobject_t name;
+  const std::string name;
   friend class read_lock;
   friend class write_lock;
   friend class excl_lock;
index 83037889bedbf887ca624ef0394996d3e5554522..56e04ac02d6b1bff5e83b0cd5d5c339d9a7b27c9 100644 (file)
@@ -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(