Skip to content

Commit 822c7d9

Browse files
committed
crimson/.../tri_mutex: use hobject_t for tri_mutex::name debug value
Useful for distinguishing between tri_mutex instances on different clones. Signed-off-by: Samuel Just <[email protected]>
1 parent a5c28ac commit 822c7d9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/crimson/common/tri_mutex.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <seastar/core/future.hh>
77
#include <seastar/core/circular_buffer.hh>
8+
9+
#include "common/hobject.h"
810
#include "crimson/common/log.h"
911

1012
class read_lock {
@@ -45,9 +47,9 @@ class tri_mutex : private read_lock,
4547
public:
4648
tri_mutex() = default;
4749
#ifdef NDEBUG
48-
tri_mutex(const std::string obj_name) : name() {}
50+
tri_mutex(const hobject_t &obj_name) : name() {}
4951
#else
50-
tri_mutex(const std::string obj_name) : name(obj_name) {}
52+
tri_mutex(const hobject_t &obj_name) : name(obj_name) {}
5153
#endif
5254
~tri_mutex();
5355

@@ -99,7 +101,7 @@ class tri_mutex : private read_lock,
99101
}
100102
}
101103

102-
std::string_view get_name() const{
104+
const hobject_t &get_name() const{
103105
return name;
104106
}
105107

@@ -122,7 +124,7 @@ class tri_mutex : private read_lock,
122124
type_t type;
123125
};
124126
seastar::circular_buffer<waiter_t> waiters;
125-
const std::string name;
127+
const hobject_t name;
126128
friend class read_lock;
127129
friend class write_lock;
128130
friend class excl_lock;

src/crimson/osd/object_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ObjectContext : public ceph::common::intrusive_lru_base<
7373
using watch_key_t = std::pair<uint64_t, entity_name_t>;
7474
std::map<watch_key_t, seastar::shared_ptr<crimson::osd::Watch>> watchers;
7575

76-
ObjectContext(hobject_t hoid) : lock(hoid.oid.name),
76+
ObjectContext(hobject_t hoid) : lock(hoid),
7777
obs(std::move(hoid)) {}
7878

7979
const hobject_t &get_oid() const {

0 commit comments

Comments
 (0)