Skip to content

Commit 0e027d5

Browse files
committed
crimson/common/tri_mutex: use string for tri_mutex::name debug
This partially reverts 822c7d9. As passing hobject::to_str instead of hoid.oid.name will also include snap info. Signed-off-by: Matan Breizman <[email protected]>
1 parent 178d312 commit 0e027d5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/crimson/common/tri_mutex.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <seastar/core/future.hh>
77
#include <seastar/core/circular_buffer.hh>
88

9-
#include "common/hobject.h"
109
#include "crimson/common/log.h"
1110

1211
class read_lock {
@@ -47,9 +46,10 @@ class tri_mutex : private read_lock,
4746
public:
4847
tri_mutex() = default;
4948
#ifdef NDEBUG
50-
tri_mutex(const hobject_t &obj_name) : name() {}
49+
tri_mutex(const std::string &obj_str) : name() {}
5150
#else
52-
tri_mutex(const hobject_t &obj_name) : name(obj_name) {}
51+
tri_mutex(const std::string &obj_str) : name(obj_str) {
52+
}
5353
#endif
5454
~tri_mutex();
5555

@@ -101,8 +101,8 @@ class tri_mutex : private read_lock,
101101
}
102102
}
103103

104-
std::string get_name() const{
105-
return name.to_str();
104+
std::string_view get_name() const{
105+
return name;
106106
}
107107

108108
private:
@@ -124,7 +124,7 @@ class tri_mutex : private read_lock,
124124
type_t type;
125125
};
126126
seastar::circular_buffer<waiter_t> waiters;
127-
const hobject_t name;
127+
const std::string name;
128128
friend class read_lock;
129129
friend class write_lock;
130130
friend class excl_lock;

src/crimson/osd/object_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class ObjectContext : public ceph::common::intrusive_lru_base<
7676

7777
CommonOBCPipeline obc_pipeline;
7878

79-
ObjectContext(hobject_t hoid) : lock(hoid),
79+
ObjectContext(hobject_t hoid) : lock(hoid.to_str()),
8080
obs(std::move(hoid)) {}
8181

8282
void update_from(

0 commit comments

Comments
 (0)