From a4f69c8bff0cca3b7a277c1837c76386bce0387c Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 5 May 2020 11:48:06 -0400 Subject: [PATCH] librbd: switched IO (un)block_write calls to new queue image dispatcher Signed-off-by: Jason Dillaman --- src/librbd/ExclusiveLock.cc | 8 +++--- .../exclusive_lock/PreReleaseRequest.cc | 2 +- src/librbd/image/RefreshRequest.cc | 6 ++--- src/librbd/image/SetSnapRequest.cc | 6 ++--- src/librbd/io/QueueImageDispatch.cc | 4 +++ .../operation/DisableFeaturesRequest.cc | 6 ++--- src/librbd/operation/EnableFeaturesRequest.cc | 6 ++--- src/librbd/operation/MigrateRequest.cc | 6 ++--- src/librbd/operation/ResizeRequest.cc | 26 +++++++++---------- src/librbd/operation/SnapshotCreateRequest.cc | 6 ++--- .../operation/SnapshotRollbackRequest.cc | 6 ++--- .../librbd/image/test_mock_RefreshRequest.cc | 4 +-- .../test_mock_DisableFeaturesRequest.cc | 4 +-- .../test_mock_EnableFeaturesRequest.cc | 4 +-- .../operation/test_mock_ResizeRequest.cc | 4 +-- .../test_mock_SnapshotCreateRequest.cc | 4 +-- .../test_mock_SnapshotRollbackRequest.cc | 4 +-- src/test/librbd/test_mock_ExclusiveLock.cc | 4 +-- 18 files changed, 57 insertions(+), 53 deletions(-) diff --git a/src/librbd/ExclusiveLock.cc b/src/librbd/ExclusiveLock.cc index 8568ae957a86b..ae43941512d04 100644 --- a/src/librbd/ExclusiveLock.cc +++ b/src/librbd/ExclusiveLock.cc @@ -9,7 +9,7 @@ #include "librbd/exclusive_lock/PreAcquireRequest.h" #include "librbd/exclusive_lock/PostAcquireRequest.h" #include "librbd/exclusive_lock/PreReleaseRequest.h" -#include "librbd/io/ImageDispatcher.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/io/ImageRequestWQ.h" #include "librbd/Utils.h" #include "common/ceph_mutex.h" @@ -133,7 +133,7 @@ void ExclusiveLock::init(uint64_t features, Context *on_init) { auto ctx = new LambdaContext([this, features, on_init](int r) { handle_init_complete(r, features, on_init); }); - m_image_ctx.io_work_queue->block_writes(ctx); + m_image_ctx.io_image_dispatcher->block_writes(ctx); } template @@ -182,7 +182,7 @@ template void ExclusiveLock::handle_init_complete(int r, uint64_t features, Context* on_finish) { if (r < 0) { - m_image_ctx.io_work_queue->unblock_writes(); + m_image_ctx.io_image_dispatcher->unblock_writes(); on_finish->complete(r); return; } @@ -193,7 +193,7 @@ void ExclusiveLock::handle_init_complete(int r, uint64_t features, m_image_ctx.io_image_dispatcher->register_dispatch(m_image_dispatch); on_finish = new LambdaContext([this, on_finish](int r) { - m_image_ctx.io_work_queue->unblock_writes(); + m_image_ctx.io_image_dispatcher->unblock_writes(); { std::lock_guard locker{ML::m_lock}; diff --git a/src/librbd/exclusive_lock/PreReleaseRequest.cc b/src/librbd/exclusive_lock/PreReleaseRequest.cc index a0227670fe82f..06a04f5c80ff6 100644 --- a/src/librbd/exclusive_lock/PreReleaseRequest.cc +++ b/src/librbd/exclusive_lock/PreReleaseRequest.cc @@ -12,7 +12,7 @@ #include "librbd/ObjectMap.h" #include "librbd/Utils.h" #include "librbd/exclusive_lock/ImageDispatch.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/io/ObjectDispatcherInterface.h" #define dout_subsys ceph_subsys_rbd diff --git a/src/librbd/image/RefreshRequest.cc b/src/librbd/image/RefreshRequest.cc index f7c4ef4df80a6..be887664295fc 100644 --- a/src/librbd/image/RefreshRequest.cc +++ b/src/librbd/image/RefreshRequest.cc @@ -19,7 +19,7 @@ #include "librbd/image/RefreshParentRequest.h" #include "librbd/io/AioCompletion.h" #include "librbd/io/ImageDispatchSpec.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/journal/Policy.h" #define dout_subsys ceph_subsys_rbd @@ -968,7 +968,7 @@ void RefreshRequest::send_v2_block_writes() { RefreshRequest, &RefreshRequest::handle_v2_block_writes>(this); std::shared_lock owner_locker{m_image_ctx.owner_lock}; - m_image_ctx.io_work_queue->block_writes(ctx); + m_image_ctx.io_image_dispatcher->block_writes(ctx); } template @@ -1174,7 +1174,7 @@ Context *RefreshRequest::handle_v2_close_journal(int *result) { ceph_assert(m_blocked_writes); m_blocked_writes = false; - m_image_ctx.io_work_queue->unblock_writes(); + m_image_ctx.io_image_dispatcher->unblock_writes(); return send_v2_close_object_map(); } diff --git a/src/librbd/image/SetSnapRequest.cc b/src/librbd/image/SetSnapRequest.cc index 0c22ad91ad112..fbc234aef9b71 100644 --- a/src/librbd/image/SetSnapRequest.cc +++ b/src/librbd/image/SetSnapRequest.cc @@ -9,7 +9,7 @@ #include "librbd/ObjectMap.h" #include "librbd/Utils.h" #include "librbd/image/RefreshParentRequest.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #define dout_subsys ceph_subsys_rbd #undef dout_prefix @@ -108,7 +108,7 @@ void SetSnapRequest::send_block_writes() { klass, &klass::handle_block_writes>(this); std::shared_lock owner_locker{m_image_ctx.owner_lock}; - m_image_ctx.io_work_queue->block_writes(ctx); + m_image_ctx.io_image_dispatcher->block_writes(ctx); } template @@ -350,7 +350,7 @@ int SetSnapRequest::apply() { template void SetSnapRequest::finalize() { if (m_writes_blocked) { - m_image_ctx.io_work_queue->unblock_writes(); + m_image_ctx.io_image_dispatcher->unblock_writes(); m_writes_blocked = false; } } diff --git a/src/librbd/io/QueueImageDispatch.cc b/src/librbd/io/QueueImageDispatch.cc index 23a087d8dccb7..4ca31a4b9674d 100644 --- a/src/librbd/io/QueueImageDispatch.cc +++ b/src/librbd/io/QueueImageDispatch.cc @@ -45,6 +45,10 @@ void QueueImageDispatch::block_writes(Context *on_blocked) { ceph_assert(ceph_mutex_is_locked(m_image_ctx->owner_lock)); auto cct = m_image_ctx->cct; + // ensure onwer lock is not held after block_writes completes + on_blocked = util::create_async_context_callback( + *m_image_ctx, on_blocked); + // TODO temp auto ctx = new C_Gather(cct, on_blocked); m_image_ctx->io_work_queue->block_writes(ctx->new_sub()); diff --git a/src/librbd/operation/DisableFeaturesRequest.cc b/src/librbd/operation/DisableFeaturesRequest.cc index c46d37f05eb70..d93da2acd454e 100644 --- a/src/librbd/operation/DisableFeaturesRequest.cc +++ b/src/librbd/operation/DisableFeaturesRequest.cc @@ -11,7 +11,7 @@ #include "librbd/Journal.h" #include "librbd/Utils.h" #include "librbd/image/SetFlagsRequest.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/journal/RemoveRequest.h" #include "librbd/mirror/DisableRequest.h" #include "librbd/object_map/RemoveRequest.h" @@ -95,7 +95,7 @@ void DisableFeaturesRequest::send_block_writes() { ldout(cct, 20) << this << " " << __func__ << dendl; std::unique_lock locker{image_ctx.owner_lock}; - image_ctx.io_work_queue->block_writes(create_context_callback< + image_ctx.io_image_dispatcher->block_writes(create_context_callback< DisableFeaturesRequest, &DisableFeaturesRequest::handle_block_writes>(this)); } @@ -633,7 +633,7 @@ Context *DisableFeaturesRequest::handle_finish(int r) { image_ctx.exclusive_lock->unblock_requests(); } - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); } image_ctx.state->handle_prepare_lock_complete(); diff --git a/src/librbd/operation/EnableFeaturesRequest.cc b/src/librbd/operation/EnableFeaturesRequest.cc index e2ca1f59be0c5..ee180107102b3 100644 --- a/src/librbd/operation/EnableFeaturesRequest.cc +++ b/src/librbd/operation/EnableFeaturesRequest.cc @@ -10,7 +10,7 @@ #include "librbd/Journal.h" #include "librbd/Utils.h" #include "librbd/image/SetFlagsRequest.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/journal/CreateRequest.h" #include "librbd/mirror/EnableRequest.h" #include "librbd/object_map/CreateRequest.h" @@ -91,7 +91,7 @@ void EnableFeaturesRequest::send_block_writes() { ldout(cct, 20) << this << " " << __func__ << dendl; std::unique_lock locker{image_ctx.owner_lock}; - image_ctx.io_work_queue->block_writes(create_context_callback< + image_ctx.io_image_dispatcher->block_writes(create_context_callback< EnableFeaturesRequest, &EnableFeaturesRequest::handle_block_writes>(this)); } @@ -476,7 +476,7 @@ Context *EnableFeaturesRequest::handle_finish(int r) { image_ctx.exclusive_lock->unblock_requests(); } if (m_writes_blocked) { - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); } } image_ctx.state->handle_prepare_lock_complete(); diff --git a/src/librbd/operation/MigrateRequest.cc b/src/librbd/operation/MigrateRequest.cc index fdd7164d3c6cd..0da4be9936a54 100644 --- a/src/librbd/operation/MigrateRequest.cc +++ b/src/librbd/operation/MigrateRequest.cc @@ -10,7 +10,7 @@ #include "librbd/Utils.h" #include "librbd/deep_copy/ObjectCopyRequest.h" #include "librbd/io/AsyncOperation.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/io/ObjectRequest.h" #include "osdc/Striper.h" #include @@ -69,7 +69,7 @@ private: m_async_op = new io::AsyncOperation(); m_async_op->start_op(image_ctx); - if (!image_ctx.io_work_queue->writes_blocked()) { + if (!image_ctx.io_image_dispatcher->writes_blocked()) { migrate_object(); return; } @@ -80,7 +80,7 @@ private: m_async_op->finish_op(); delete m_async_op; m_async_op = nullptr; - image_ctx.io_work_queue->wait_on_writes_unblocked(ctx); + image_ctx.io_image_dispatcher->wait_on_writes_unblocked(ctx); } void handle_start_async_op(int r) { diff --git a/src/librbd/operation/ResizeRequest.cc b/src/librbd/operation/ResizeRequest.cc index 53673980e9670..6179df66b17ec 100644 --- a/src/librbd/operation/ResizeRequest.cc +++ b/src/librbd/operation/ResizeRequest.cc @@ -9,7 +9,7 @@ #include "librbd/Utils.h" #include "librbd/io/AioCompletion.h" #include "librbd/io/ImageDispatchSpec.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/io/ObjectDispatcherInterface.h" #include "librbd/operation/TrimRequest.h" #include "common/dout.h" @@ -96,7 +96,7 @@ void ResizeRequest::send_pre_block_writes() { CephContext *cct = image_ctx.cct; ldout(cct, 5) << dendl; - image_ctx.io_work_queue->block_writes(create_context_callback< + image_ctx.io_image_dispatcher->block_writes(create_context_callback< ResizeRequest, &ResizeRequest::handle_pre_block_writes>(this)); } @@ -108,7 +108,7 @@ Context *ResizeRequest::handle_pre_block_writes(int *result) { if (*result < 0) { lderr(cct) << "failed to block writes: " << cpp_strerror(*result) << dendl; - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); return this->create_context_finisher(*result); } @@ -122,7 +122,7 @@ Context *ResizeRequest::send_append_op_event() { if (m_new_size < m_original_size && !m_allow_shrink) { ldout(cct, 1) << "shrinking the image is not permitted" << dendl; - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); this->async_complete(-EINVAL); return nullptr; } @@ -145,7 +145,7 @@ Context *ResizeRequest::handle_append_op_event(int *result) { if (*result < 0) { lderr(cct) << "failed to commit journal entry: " << cpp_strerror(*result) << dendl; - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); return this->create_context_finisher(*result); } @@ -260,10 +260,10 @@ Context *ResizeRequest::send_grow_object_map() { } if (m_original_size == m_new_size) { - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); return this->create_context_finisher(0); } else if (m_new_size < m_original_size) { - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); send_flush_cache(); return nullptr; } @@ -303,7 +303,7 @@ Context *ResizeRequest::handle_grow_object_map(int *result) { if (*result < 0) { lderr(cct) << "failed to resize object map: " << cpp_strerror(*result) << dendl; - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); return this->create_context_finisher(*result); } @@ -351,7 +351,7 @@ Context *ResizeRequest::handle_shrink_object_map(int *result) { if (*result < 0) { lderr(cct) << "failed to resize object map: " << cpp_strerror(*result) << dendl; - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); return this->create_context_finisher(*result); } @@ -366,7 +366,7 @@ void ResizeRequest::send_post_block_writes() { ldout(cct, 5) << dendl; std::shared_lock owner_locker{image_ctx.owner_lock}; - image_ctx.io_work_queue->block_writes(create_context_callback< + image_ctx.io_image_dispatcher->block_writes(create_context_callback< ResizeRequest, &ResizeRequest::handle_post_block_writes>(this)); } @@ -377,7 +377,7 @@ Context *ResizeRequest::handle_post_block_writes(int *result) { ldout(cct, 5) << "r=" << *result << dendl; if (*result < 0) { - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); lderr(cct) << "failed to block writes prior to header update: " << cpp_strerror(*result) << dendl; return this->create_context_finisher(*result); @@ -427,7 +427,7 @@ Context *ResizeRequest::handle_update_header(int *result) { if (*result < 0) { lderr(cct) << "failed to update image header: " << cpp_strerror(*result) << dendl; - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); return this->create_context_finisher(*result); } @@ -459,7 +459,7 @@ void ResizeRequest::update_size_and_overlap() { } // blocked by PRE_BLOCK_WRITES (grow) or POST_BLOCK_WRITES (shrink) state - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); } } // namespace operation diff --git a/src/librbd/operation/SnapshotCreateRequest.cc b/src/librbd/operation/SnapshotCreateRequest.cc index b16cdf24ffb7d..7a957b002159c 100644 --- a/src/librbd/operation/SnapshotCreateRequest.cc +++ b/src/librbd/operation/SnapshotCreateRequest.cc @@ -10,7 +10,7 @@ #include "librbd/ImageWatcher.h" #include "librbd/ObjectMap.h" #include "librbd/Utils.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/mirror/snapshot/SetImageStateRequest.h" #define dout_subsys ceph_subsys_rbd @@ -111,7 +111,7 @@ void SnapshotCreateRequest::send_suspend_aio() { CephContext *cct = image_ctx.cct; ldout(cct, 5) << this << " " << __func__ << dendl; - image_ctx.io_work_queue->block_writes(create_context_callback< + image_ctx.io_image_dispatcher->block_writes(create_context_callback< SnapshotCreateRequest, &SnapshotCreateRequest::handle_suspend_aio>(this)); } @@ -360,7 +360,7 @@ void SnapshotCreateRequest::send_notify_unquiesce() { CephContext *cct = image_ctx.cct; ldout(cct, 5) << this << " " << __func__ << dendl; - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); image_ctx.image_watcher->notify_unquiesce( m_request_id, create_context_callback< diff --git a/src/librbd/operation/SnapshotRollbackRequest.cc b/src/librbd/operation/SnapshotRollbackRequest.cc index a18f79509f35f..87c155c63555b 100644 --- a/src/librbd/operation/SnapshotRollbackRequest.cc +++ b/src/librbd/operation/SnapshotRollbackRequest.cc @@ -9,7 +9,7 @@ #include "librbd/ImageCtx.h" #include "librbd/ObjectMap.h" #include "librbd/Utils.h" -#include "librbd/io/ImageRequestWQ.h" +#include "librbd/io/ImageDispatcherInterface.h" #include "librbd/io/ObjectDispatcherInterface.h" #include "librbd/operation/ResizeRequest.h" #include "osdc/Striper.h" @@ -95,7 +95,7 @@ template SnapshotRollbackRequest::~SnapshotRollbackRequest() { I &image_ctx = this->m_image_ctx; if (m_blocking_writes) { - image_ctx.io_work_queue->unblock_writes(); + image_ctx.io_image_dispatcher->unblock_writes(); } if (m_object_map) { m_object_map->put(); @@ -119,7 +119,7 @@ void SnapshotRollbackRequest::send_block_writes() { ldout(cct, 5) << this << " " << __func__ << dendl; m_blocking_writes = true; - image_ctx.io_work_queue->block_writes(create_context_callback< + image_ctx.io_image_dispatcher->block_writes(create_context_callback< SnapshotRollbackRequest, &SnapshotRollbackRequest::handle_block_writes>(this)); } diff --git a/src/test/librbd/image/test_mock_RefreshRequest.cc b/src/test/librbd/image/test_mock_RefreshRequest.cc index 50c60cb563890..8bf2c56eb0751 100644 --- a/src/test/librbd/image/test_mock_RefreshRequest.cc +++ b/src/test/librbd/image/test_mock_RefreshRequest.cc @@ -508,12 +508,12 @@ public: } void expect_block_writes(MockImageCtx &mock_image_ctx, int r) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, block_writes(_)) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, block_writes(_)) .WillOnce(CompleteContext(r, mock_image_ctx.image_ctx->op_work_queue)); } void expect_unblock_writes(MockImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, unblock_writes()) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, unblock_writes()) .Times(1); } diff --git a/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc b/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc index ec374d518e96a..85298eeb3d025 100644 --- a/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc +++ b/src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc @@ -204,12 +204,12 @@ public: } void expect_block_writes(MockOperationImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, block_writes(_)) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, block_writes(_)) .WillOnce(CompleteContext(0, mock_image_ctx.image_ctx->op_work_queue)); } void expect_unblock_writes(MockOperationImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, unblock_writes()).Times(1); + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, unblock_writes()).Times(1); } void expect_verify_lock_ownership(MockOperationImageCtx &mock_image_ctx) { diff --git a/src/test/librbd/operation/test_mock_EnableFeaturesRequest.cc b/src/test/librbd/operation/test_mock_EnableFeaturesRequest.cc index 7f2fd30ecdfcb..1e99489aaafdf 100644 --- a/src/test/librbd/operation/test_mock_EnableFeaturesRequest.cc +++ b/src/test/librbd/operation/test_mock_EnableFeaturesRequest.cc @@ -216,12 +216,12 @@ public: } void expect_block_writes(MockOperationImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, block_writes(_)) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, block_writes(_)) .WillOnce(CompleteContext(0, mock_image_ctx.image_ctx->op_work_queue)); } void expect_unblock_writes(MockOperationImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, unblock_writes()).Times(1); + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, unblock_writes()).Times(1); } void expect_verify_lock_ownership(MockOperationImageCtx &mock_image_ctx) { diff --git a/src/test/librbd/operation/test_mock_ResizeRequest.cc b/src/test/librbd/operation/test_mock_ResizeRequest.cc index 764f2721327d9..71992734282d1 100644 --- a/src/test/librbd/operation/test_mock_ResizeRequest.cc +++ b/src/test/librbd/operation/test_mock_ResizeRequest.cc @@ -101,12 +101,12 @@ public: typedef io::ImageDispatchSpec MockIoImageDispatchSpec; void expect_block_writes(MockImageCtx &mock_image_ctx, int r) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, block_writes(_)) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, block_writes(_)) .WillOnce(CompleteContext(r, mock_image_ctx.image_ctx->op_work_queue)); } void expect_unblock_writes(MockImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, unblock_writes()) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, unblock_writes()) .Times(1); } diff --git a/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc b/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc index 905199d9e7295..650369748a512 100644 --- a/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc @@ -69,7 +69,7 @@ public: } void expect_block_writes(MockImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, block_writes(_)) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, block_writes(_)) .WillOnce(CompleteContext(0, mock_image_ctx.image_ctx->op_work_queue)); } @@ -139,7 +139,7 @@ public: } void expect_unblock_writes(MockImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, unblock_writes()) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, unblock_writes()) .Times(1); } diff --git a/src/test/librbd/operation/test_mock_SnapshotRollbackRequest.cc b/src/test/librbd/operation/test_mock_SnapshotRollbackRequest.cc index fa14ddb37fed2..85522543f1278 100644 --- a/src/test/librbd/operation/test_mock_SnapshotRollbackRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotRollbackRequest.cc @@ -85,12 +85,12 @@ public: typedef ResizeRequest MockResizeRequest; void expect_block_writes(MockOperationImageCtx &mock_image_ctx, int r) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, block_writes(_)) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, block_writes(_)) .WillOnce(CompleteContext(r, mock_image_ctx.image_ctx->op_work_queue)); } void expect_unblock_writes(MockOperationImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, unblock_writes()) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, unblock_writes()) .Times(1); } diff --git a/src/test/librbd/test_mock_ExclusiveLock.cc b/src/test/librbd/test_mock_ExclusiveLock.cc index 767e4492a99eb..19b28722ccae2 100644 --- a/src/test/librbd/test_mock_ExclusiveLock.cc +++ b/src/test/librbd/test_mock_ExclusiveLock.cc @@ -275,12 +275,12 @@ public: void expect_block_writes(MockExclusiveLockImageCtx &mock_image_ctx, MockImageDispatch& mock_image_dispatch) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, block_writes(_)) + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, block_writes(_)) .WillOnce(CompleteContext(0, mock_image_ctx.image_ctx->op_work_queue)); } void expect_unblock_writes(MockExclusiveLockImageCtx &mock_image_ctx) { - EXPECT_CALL(*mock_image_ctx.io_work_queue, unblock_writes()); + EXPECT_CALL(*mock_image_ctx.io_image_dispatcher, unblock_writes()); } void expect_register_dispatch(MockExclusiveLockImageCtx &mock_image_ctx) { -- 2.39.5