mirror of
https://github.com/ceph/ceph
synced 2024-12-30 15:33:31 +00:00
Merge pull request #13033 from dillaman/wip-18618
journal: don't hold future lock during assignment Reviewed-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
commit
fce69f6348
@ -39,13 +39,12 @@ void FutureImpl::flush(Context *on_safe) {
|
||||
m_contexts.push_back(on_safe);
|
||||
}
|
||||
|
||||
prev_future = prepare_flush(&flush_handlers);
|
||||
prev_future = prepare_flush(&flush_handlers, m_lock);
|
||||
}
|
||||
}
|
||||
|
||||
// instruct prior futures to flush as well
|
||||
while (prev_future) {
|
||||
Mutex::Locker locker(prev_future->m_lock);
|
||||
prev_future = prev_future->prepare_flush(&flush_handlers);
|
||||
}
|
||||
|
||||
@ -62,6 +61,12 @@ void FutureImpl::flush(Context *on_safe) {
|
||||
}
|
||||
|
||||
FutureImplPtr FutureImpl::prepare_flush(FlushHandlers *flush_handlers) {
|
||||
Mutex::Locker locker(m_lock);
|
||||
return prepare_flush(flush_handlers, m_lock);
|
||||
}
|
||||
|
||||
FutureImplPtr FutureImpl::prepare_flush(FlushHandlers *flush_handlers,
|
||||
Mutex &lock) {
|
||||
assert(m_lock.is_locked());
|
||||
|
||||
if (m_flush_state == FLUSH_STATE_NONE) {
|
||||
|
@ -113,6 +113,7 @@ private:
|
||||
Contexts m_contexts;
|
||||
|
||||
FutureImplPtr prepare_flush(FlushHandlers *flush_handlers);
|
||||
FutureImplPtr prepare_flush(FlushHandlers *flush_handlers, Mutex &lock);
|
||||
|
||||
void consistent(int r);
|
||||
void finish_unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user