mirror of
https://github.com/ceph/ceph
synced 2025-02-22 10:37:15 +00:00
crimson/osd: make sure the read lock is acquired when trying to get recovery read
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
This commit is contained in:
parent
98d8d25b39
commit
0b8ac4ccc3
@ -93,6 +93,9 @@ public:
|
||||
void unlock_for_read();
|
||||
void promote_from_read();
|
||||
void demote_to_read();
|
||||
unsigned get_readers() const {
|
||||
return readers;
|
||||
}
|
||||
|
||||
// for shared writers
|
||||
seastar::future<> lock_for_write(bool greedy);
|
||||
@ -100,11 +103,17 @@ public:
|
||||
void unlock_for_write();
|
||||
void promote_from_write();
|
||||
void demote_to_write();
|
||||
unsigned get_writers() const {
|
||||
return writers;
|
||||
}
|
||||
|
||||
// for exclusive users
|
||||
seastar::future<> lock_for_excl();
|
||||
bool try_lock_for_excl() noexcept;
|
||||
void unlock_for_excl();
|
||||
bool is_excl_acquired() const {
|
||||
return exclusively_used;
|
||||
}
|
||||
|
||||
bool is_acquired() const;
|
||||
|
||||
|
@ -155,6 +155,7 @@ public:
|
||||
}
|
||||
}
|
||||
void wait_recovery_read() {
|
||||
assert(lock.get_readers() > 0);
|
||||
recovery_read_marker = true;
|
||||
}
|
||||
void drop_recovery_read() {
|
||||
|
Loading…
Reference in New Issue
Block a user