]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: switched IO (un)block_write calls to new queue image dispatcher
authorJason Dillaman <dillaman@redhat.com>
Tue, 5 May 2020 15:48:06 +0000 (11:48 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 14 May 2020 15:56:45 +0000 (11:56 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
18 files changed:
src/librbd/ExclusiveLock.cc
src/librbd/exclusive_lock/PreReleaseRequest.cc
src/librbd/image/RefreshRequest.cc
src/librbd/image/SetSnapRequest.cc
src/librbd/io/QueueImageDispatch.cc
src/librbd/operation/DisableFeaturesRequest.cc
src/librbd/operation/EnableFeaturesRequest.cc
src/librbd/operation/MigrateRequest.cc
src/librbd/operation/ResizeRequest.cc
src/librbd/operation/SnapshotCreateRequest.cc
src/librbd/operation/SnapshotRollbackRequest.cc
src/test/librbd/image/test_mock_RefreshRequest.cc
src/test/librbd/operation/test_mock_DisableFeaturesRequest.cc
src/test/librbd/operation/test_mock_EnableFeaturesRequest.cc
src/test/librbd/operation/test_mock_ResizeRequest.cc
src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc
src/test/librbd/operation/test_mock_SnapshotRollbackRequest.cc
src/test/librbd/test_mock_ExclusiveLock.cc

index 8568ae957a86b3a452b03e7bf0d81d93553a04c1..ae43941512d04829d6553faf5d2bd1c9475a7522 100644 (file)
@@ -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<I>::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 <typename I>
@@ -182,7 +182,7 @@ template <typename I>
 void ExclusiveLock<I>::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<I>::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<I>::m_lock};
index a0227670fe82fa7eb30ada0ef1b3aa74db7c882d..06a04f5c80ff69fcca051437d9ba51e2f3c5da97 100644 (file)
@@ -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
index f7c4ef4df80a60612184c3b133a90297bb536c4b..be887664295fc62d49b5b6595639e2afc6011459 100644 (file)
@@ -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<I>::send_v2_block_writes() {
     RefreshRequest<I>, &RefreshRequest<I>::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 <typename I>
@@ -1174,7 +1174,7 @@ Context *RefreshRequest<I>::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();
 }
 
index 0c22ad91ad1124294db4c19c58fae8e2cc45a0e8..fbc234aef9b71067d6eb04cb16389f30cd421cb3 100644 (file)
@@ -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<I>::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 <typename I>
@@ -350,7 +350,7 @@ int SetSnapRequest<I>::apply() {
 template <typename I>
 void SetSnapRequest<I>::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;
   }
 }
index 23a087d8dccb730aa3c306925cd069a08764f503..4ca31a4b9674db3d4ea3dae7c40fa0ab64e07a09 100644 (file)
@@ -45,6 +45,10 @@ void QueueImageDispatch<I>::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());
index c46d37f05eb707e75dee2f0daa23131ceb35ae6b..d93da2acd454e6594fd2f926a70266d838912274 100644 (file)
@@ -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<I>::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<I>,
     &DisableFeaturesRequest<I>::handle_block_writes>(this));
 }
@@ -633,7 +633,7 @@ Context *DisableFeaturesRequest<I>::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();
 
index e2ca1f59be0c5e632dbd2911a2689833bafc2acb..ee180107102b3d1d39be9afdcced0b33e574470f 100644 (file)
@@ -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<I>::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<I>,
     &EnableFeaturesRequest<I>::handle_block_writes>(this));
 }
@@ -476,7 +476,7 @@ Context *EnableFeaturesRequest<I>::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();
index fdd7164d3c6cdb7cf8be7b172cc43d7a7dcdd525..0da4be9936a54f766f5064c32fe23f1c7ef23f42 100644 (file)
@@ -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 <boost/lambda/bind.hpp>
@@ -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) {
index 53673980e9670be55c982d59c74bd25ed6e7e53e..6179df66b17ec89af7759d61f7d2727d2e9c145f 100644 (file)
@@ -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<I>::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<I>, &ResizeRequest<I>::handle_pre_block_writes>(this));
 }
 
@@ -108,7 +108,7 @@ Context *ResizeRequest<I>::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<I>::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<I>::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<I>::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<I>::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<I>::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<I>::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<I>, &ResizeRequest<I>::handle_post_block_writes>(this));
 }
 
@@ -377,7 +377,7 @@ Context *ResizeRequest<I>::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<I>::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<I>::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
index b16cdf24ffb7def8c7bc593eca2f66ba956b07d5..7a957b002159c158a35584d75d53b4612a79e82c 100644 (file)
@@ -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<I>::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<I>,
     &SnapshotCreateRequest<I>::handle_suspend_aio>(this));
 }
@@ -360,7 +360,7 @@ void SnapshotCreateRequest<I>::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<
index a18f79509f35f3ce01078ef8465e8f1361a0b9bb..87c155c63555b8727c625c5cc956e5a123891a06 100644 (file)
@@ -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 <typename I>
 SnapshotRollbackRequest<I>::~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<I>::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<I>,
     &SnapshotRollbackRequest<I>::handle_block_writes>(this));
 }
index 50c60cb5638908360fde69369cab486d6471170a..8bf2c56eb0751be52d7bb6c1c544332228b1fc1d 100644 (file)
@@ -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);
   }
 
index ec374d518e96adb033f93d3f882904129062bfc4..85298eeb3d0256a1f0b65c73ae5e31b1ce1f723a 100644 (file)
@@ -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) {
index 7f2fd30ecdfcbbbdfb5904762405a6221104dc08..1e99489aaafdf27991d05ef8457eaf2b3582cf8c 100644 (file)
@@ -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) {
index 764f2721327d9d79766a63b20cffc76d30def741..71992734282d1911963449af382a19704a7fb55d 100644 (file)
@@ -101,12 +101,12 @@ public:
   typedef io::ImageDispatchSpec<MockImageCtx> 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);
   }
 
index 905199d9e72954d28d9f3a9907ff4f56dcf2425a..650369748a5126e6801cd176881460d636471a13 100644 (file)
@@ -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);
   }
 
index fa14ddb37fed2188701bba3349b552965e2c4d2f..85522543f1278325f687f1cc9e9d9cdf501cec92 100644 (file)
@@ -85,12 +85,12 @@ public:
   typedef ResizeRequest<MockOperationImageCtx> 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);
   }
 
index 767e4492a99eb3efb180ab1cb4a61e73291778d2..19b28722ccae205b82abd2c37a472cd851a3ff73 100644 (file)
@@ -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) {