From ab1b152414d479bace9438adddc7cd89d67bbd23 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 9 Jul 2020 11:58:31 -0400 Subject: [PATCH] test/librados_test_stub: pass read snap id to read operation hooks The neorados API does not require the creation of heavy IoCtx-like objects with static read snap_ids pre-assigned. Therefore, we will need to pass the read snap_id to all affected functions and adjust all dependent unittests to expect a new parameter. Signed-off-by: Jason Dillaman --- .../librados_test_stub/LibradosTestStub.cc | 68 +++++++++++-------- .../librados_test_stub/MockTestMemIoCtxImpl.h | 48 +++++++------ .../librados_test_stub/TestClassHandler.cc | 3 +- .../librados_test_stub/TestClassHandler.h | 2 + src/test/librados_test_stub/TestIoCtxImpl.cc | 28 ++++---- src/test/librados_test_stub/TestIoCtxImpl.h | 17 +++-- .../librados_test_stub/TestMemIoCtxImpl.cc | 58 ++++++++-------- .../librados_test_stub/TestMemIoCtxImpl.h | 11 +-- .../test_mock_MetadataCopyRequest.cc | 2 +- .../deep_copy/test_mock_ObjectCopyRequest.cc | 3 +- .../deep_copy/test_mock_SetHeadRequest.cc | 3 +- .../test_mock_SnapshotCreateRequest.cc | 3 +- .../image/test_mock_AttachChildRequest.cc | 7 +- .../image/test_mock_AttachParentRequest.cc | 4 +- .../librbd/image/test_mock_CloneRequest.cc | 2 +- .../image/test_mock_DetachChildRequest.cc | 8 +-- .../image/test_mock_DetachParentRequest.cc | 4 +- .../image/test_mock_PreRemoveRequest.cc | 2 +- .../librbd/image/test_mock_RefreshRequest.cc | 59 ++++++++++------ .../librbd/image/test_mock_RemoveRequest.cc | 6 +- .../image/test_mock_ValidatePoolRequest.cc | 2 +- src/test/librbd/io/test_mock_CopyupRequest.cc | 4 +- src/test/librbd/io/test_mock_ObjectRequest.cc | 9 +-- .../managed_lock/test_mock_AcquireRequest.cc | 2 +- .../managed_lock/test_mock_BreakRequest.cc | 3 +- .../test_mock_GetLockerRequest.cc | 2 +- .../test_mock_ReacquireRequest.cc | 2 +- .../managed_lock/test_mock_ReleaseRequest.cc | 2 +- .../test_mock_CreateNonPrimaryRequest.cc | 4 +- .../test_mock_CreatePrimaryRequest.cc | 2 +- .../mirror/snapshot/test_mock_ImageMeta.cc | 4 +- .../snapshot/test_mock_UnlinkPeerRequest.cc | 2 +- .../librbd/mirror/test_mock_DisableRequest.cc | 4 +- .../object_map/test_mock_InvalidateRequest.cc | 15 ++-- .../object_map/test_mock_LockRequest.cc | 8 ++- .../object_map/test_mock_RefreshRequest.cc | 6 +- .../object_map/test_mock_ResizeRequest.cc | 12 ++-- .../test_mock_SnapshotCreateRequest.cc | 16 +++-- .../test_mock_SnapshotRemoveRequest.cc | 18 +++-- .../test_mock_SnapshotRollbackRequest.cc | 9 +-- .../object_map/test_mock_UnlockRequest.cc | 2 +- .../object_map/test_mock_UpdateRequest.cc | 10 +-- .../operation/test_mock_ResizeRequest.cc | 3 +- .../test_mock_SnapshotCreateRequest.cc | 2 +- .../test_mock_SnapshotProtectRequest.cc | 3 +- .../test_mock_SnapshotRemoveRequest.cc | 10 +-- .../test_mock_SnapshotUnprotectRequest.cc | 8 +-- src/test/librbd/test_mock_fixture.cc | 2 +- .../librbd/trash/test_mock_MoveRequest.cc | 4 +- .../librbd/trash/test_mock_RemoveRequest.cc | 4 +- .../test_mock_TrashMoveRequest.cc | 9 +-- .../test_mock_TrashRemoveRequest.cc | 6 +- .../image_deleter/test_mock_TrashWatcher.cc | 2 +- .../test_mock_ApplyImageStateRequest.cc | 4 +- .../test_mock_CreateLocalImageRequest.cc | 4 +- .../snapshot/test_mock_Replayer.cc | 2 +- .../test_mock_CreateImageRequest.cc | 6 +- .../test_mock_GetMirrorImageIdRequest.cc | 3 +- .../test_mock_PrepareLocalImageRequest.cc | 3 +- .../test_mock_RefreshImagesRequest.cc | 3 +- .../rbd_mirror/test_mock_InstanceWatcher.cc | 4 +- .../test_mock_MirrorStatusUpdater.cc | 2 +- src/test/rbd_mirror/test_mock_PoolReplayer.cc | 6 +- 63 files changed, 324 insertions(+), 242 deletions(-) diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 93d0e3bb92fae..1a920603039ba 100644 --- a/src/test/librados_test_stub/LibradosTestStub.cc +++ b/src/test/librados_test_stub/LibradosTestStub.cc @@ -428,7 +428,8 @@ int IoCtx::aio_operate(const std::string& oid, AioCompletion *c, bufferlist *pbl) { TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); TestObjectOperationImpl *ops = reinterpret_cast(op->impl); - return ctx->aio_operate_read(oid, *ops, c->pc, flags, pbl); + return ctx->aio_operate_read(oid, *ops, c->pc, flags, pbl, + ctx->get_snap_read()); } int IoCtx::aio_operate(const std::string& oid, AioCompletion *c, @@ -525,7 +526,8 @@ int IoCtx::exec(const std::string& oid, const char *cls, const char *method, TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); return ctx->execute_operation( oid, boost::bind(&TestIoCtxImpl::exec, _1, _2, get_class_handler(), cls, - method, inbl, &outbl, ctx->get_snap_context())); + method, inbl, &outbl, ctx->get_snap_read(), + ctx->get_snap_context())); } void IoCtx::from_rados_ioctx_t(rados_ioctx_t p, IoCtx &io) { @@ -613,7 +615,8 @@ int IoCtx::read(const std::string& oid, bufferlist& bl, size_t len, uint64_t off) { TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); return ctx->execute_operation( - oid, boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, &bl)); + oid, boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, &bl, + ctx->get_snap_read())); } int IoCtx::remove(const std::string& oid) { @@ -663,7 +666,8 @@ int IoCtx::sparse_read(const std::string& oid, std::map& m, bufferlist& bl, size_t len, uint64_t off) { TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); return ctx->execute_operation( - oid, boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, &m, &bl)); + oid, boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, &m, &bl, + ctx->get_snap_read())); } int IoCtx::stat(const std::string& oid, uint64_t *psize, time_t *pmtime) { @@ -733,7 +737,8 @@ int IoCtx::writesame(const std::string& oid, bufferlist& bl, size_t len, int IoCtx::cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) { TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); return ctx->execute_operation( - oid, boost::bind(&TestIoCtxImpl::cmpext, _1, _2, off, cmp_bl)); + oid, boost::bind(&TestIoCtxImpl::cmpext, _1, _2, off, cmp_bl, + ctx->get_snap_read())); } int IoCtx::application_enable(const std::string& app_name, bool force) { @@ -804,14 +809,15 @@ ObjectOperation::~ObjectOperation() { void ObjectOperation::assert_exists() { TestObjectOperationImpl *o = reinterpret_cast(impl); - o->ops.push_back(boost::bind(&TestIoCtxImpl::assert_exists, _1, _2)); + o->ops.push_back(boost::bind(&TestIoCtxImpl::assert_exists, _1, _2, _4)); } void ObjectOperation::exec(const char *cls, const char *method, bufferlist& inbl) { TestObjectOperationImpl *o = reinterpret_cast(impl); o->ops.push_back(boost::bind(&TestIoCtxImpl::exec, _1, _2, - get_class_handler(), cls, method, inbl, _3, _4)); + get_class_handler(), cls, method, inbl, _3, _4, + _5)); } void ObjectOperation::set_op_flags2(int flags) { @@ -825,10 +831,11 @@ size_t ObjectOperation::size() { void ObjectOperation::cmpext(uint64_t off, const bufferlist& cmp_bl, int *prval) { TestObjectOperationImpl *o = reinterpret_cast(impl); - ObjectOperationTestImpl op = boost::bind(&TestIoCtxImpl::cmpext, _1, _2, off, cmp_bl); + ObjectOperationTestImpl op = boost::bind(&TestIoCtxImpl::cmpext, _1, _2, off, + cmp_bl, _4); if (prval != NULL) { op = boost::bind(save_operation_result, - boost::bind(op, _1, _2, _3, _4), prval); + boost::bind(op, _1, _2, _3, _4, _5), prval); } o->ops.push_back(op); } @@ -840,7 +847,7 @@ void ObjectReadOperation::list_snaps(snap_set_t *out_snaps, int *prval) { out_snaps); if (prval != NULL) { op = boost::bind(save_operation_result, - boost::bind(op, _1, _2, _3, _4), prval); + boost::bind(op, _1, _2, _3, _4, _5), prval); } o->ops.push_back(op); } @@ -853,7 +860,7 @@ void ObjectReadOperation::list_watchers(std::list *out_watchers, _2, out_watchers); if (prval != NULL) { op = boost::bind(save_operation_result, - boost::bind(op, _1, _2, _3, _4), prval); + boost::bind(op, _1, _2, _3, _4, _5), prval); } o->ops.push_back(op); } @@ -864,14 +871,14 @@ void ObjectReadOperation::read(size_t off, uint64_t len, bufferlist *pbl, ObjectOperationTestImpl op; if (pbl != NULL) { - op = boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, pbl); + op = boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, pbl, _4); } else { - op = boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, _3); + op = boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, _3, _4); } if (prval != NULL) { op = boost::bind(save_operation_result, - boost::bind(op, _1, _2, _3, _4), prval); + boost::bind(op, _1, _2, _3, _4, _5), prval); } o->ops.push_back(op); } @@ -883,14 +890,14 @@ void ObjectReadOperation::sparse_read(uint64_t off, uint64_t len, ObjectOperationTestImpl op; if (pbl != NULL) { - op = boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, pbl); + op = boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, pbl, _4); } else { - op = boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, _3); + op = boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, _3, _4); } if (prval != NULL) { op = boost::bind(save_operation_result, - boost::bind(op, _1, _2, _3, _4), prval); + boost::bind(op, _1, _2, _3, _4, _5), prval); } o->ops.push_back(op); } @@ -903,19 +910,19 @@ void ObjectReadOperation::stat(uint64_t *psize, time_t *pmtime, int *prval) { if (prval != NULL) { op = boost::bind(save_operation_result, - boost::bind(op, _1, _2, _3, _4), prval); + boost::bind(op, _1, _2, _3, _4, _5), prval); } o->ops.push_back(op); } void ObjectWriteOperation::append(const bufferlist &bl) { TestObjectOperationImpl *o = reinterpret_cast(impl); - o->ops.push_back(boost::bind(&TestIoCtxImpl::append, _1, _2, bl, _4)); + o->ops.push_back(boost::bind(&TestIoCtxImpl::append, _1, _2, bl, _5)); } void ObjectWriteOperation::create(bool exclusive) { TestObjectOperationImpl *o = reinterpret_cast(impl); - o->ops.push_back(boost::bind(&TestIoCtxImpl::create, _1, _2, exclusive, _4)); + o->ops.push_back(boost::bind(&TestIoCtxImpl::create, _1, _2, exclusive, _5)); } void ObjectWriteOperation::omap_set(const std::map &map) { @@ -925,7 +932,7 @@ void ObjectWriteOperation::omap_set(const std::map &map void ObjectWriteOperation::remove() { TestObjectOperationImpl *o = reinterpret_cast(impl); - o->ops.push_back(boost::bind(&TestIoCtxImpl::remove, _1, _2, _4)); + o->ops.push_back(boost::bind(&TestIoCtxImpl::remove, _1, _2, _5)); } void ObjectWriteOperation::selfmanaged_snap_rollback(uint64_t snapid) { @@ -939,7 +946,7 @@ void ObjectWriteOperation::set_alloc_hint(uint64_t expected_object_size, TestObjectOperationImpl *o = reinterpret_cast(impl); o->ops.push_back(boost::bind(&TestIoCtxImpl::set_alloc_hint, _1, _2, expected_object_size, expected_write_size, 0, - _4)); + _5)); } void ObjectWriteOperation::set_alloc_hint2(uint64_t expected_object_size, @@ -948,7 +955,7 @@ void ObjectWriteOperation::set_alloc_hint2(uint64_t expected_object_size, TestObjectOperationImpl *o = reinterpret_cast(impl); o->ops.push_back(boost::bind(&TestIoCtxImpl::set_alloc_hint, _1, _2, expected_object_size, expected_write_size, flags, - _4)); + _5)); } void ObjectWriteOperation::tmap_update(const bufferlist& cmdbl) { @@ -959,29 +966,30 @@ void ObjectWriteOperation::tmap_update(const bufferlist& cmdbl) { void ObjectWriteOperation::truncate(uint64_t off) { TestObjectOperationImpl *o = reinterpret_cast(impl); - o->ops.push_back(boost::bind(&TestIoCtxImpl::truncate, _1, _2, off, _4)); + o->ops.push_back(boost::bind(&TestIoCtxImpl::truncate, _1, _2, off, _5)); } void ObjectWriteOperation::write(uint64_t off, const bufferlist& bl) { TestObjectOperationImpl *o = reinterpret_cast(impl); o->ops.push_back(boost::bind(&TestIoCtxImpl::write, _1, _2, bl, bl.length(), - off, _4)); + off, _5)); } void ObjectWriteOperation::write_full(const bufferlist& bl) { TestObjectOperationImpl *o = reinterpret_cast(impl); - o->ops.push_back(boost::bind(&TestIoCtxImpl::write_full, _1, _2, bl, _4)); + o->ops.push_back(boost::bind(&TestIoCtxImpl::write_full, _1, _2, bl, _5)); } -void ObjectWriteOperation::writesame(uint64_t off, uint64_t len, const bufferlist& bl) { +void ObjectWriteOperation::writesame(uint64_t off, uint64_t len, + const bufferlist& bl) { TestObjectOperationImpl *o = reinterpret_cast(impl); o->ops.push_back(boost::bind(&TestIoCtxImpl::writesame, _1, _2, bl, len, - off, _4)); + off, _5)); } void ObjectWriteOperation::zero(uint64_t off, uint64_t len) { TestObjectOperationImpl *o = reinterpret_cast(impl); - o->ops.push_back(boost::bind(&TestIoCtxImpl::zero, _1, _2, off, len, _4)); + o->ops.push_back(boost::bind(&TestIoCtxImpl::zero, _1, _2, off, len, _5)); } Rados::Rados() : client(NULL) { @@ -1365,7 +1373,7 @@ int cls_cxx_read2(cls_method_context_t hctx, int ofs, int len, bufferlist *outbl, uint32_t op_flags) { librados::TestClassHandler::MethodContext *ctx = reinterpret_cast(hctx); - return ctx->io_ctx_impl->read(ctx->oid, len, ofs, outbl); + return ctx->io_ctx_impl->read(ctx->oid, len, ofs, outbl, ctx->snap_id); } int cls_cxx_setxattr(cls_method_context_t hctx, const char *name, diff --git a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h index fc86c287fe98c..765af67367f15 100644 --- a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h @@ -63,9 +63,9 @@ public: return TestMemIoCtxImpl::aio_unwatch(handle, c); } - MOCK_METHOD1(assert_exists, int(const std::string &)); - int do_assert_exists(const std::string &oid) { - return TestMemIoCtxImpl::assert_exists(oid); + MOCK_METHOD2(assert_exists, int(const std::string &, uint64_t)); + int do_assert_exists(const std::string &oid, uint64_t snap_id) { + return TestMemIoCtxImpl::assert_exists(oid, snap_id); } MOCK_METHOD3(create, int(const std::string&, bool, const SnapContext &)); @@ -74,23 +74,26 @@ public: return TestMemIoCtxImpl::create(oid, exclusive, snapc); } - MOCK_METHOD3(cmpext, int(const std::string&, uint64_t, bufferlist&)); - int do_cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) { - return TestMemIoCtxImpl::cmpext(oid, off, cmp_bl); + MOCK_METHOD4(cmpext, int(const std::string&, uint64_t, bufferlist&, + uint64_t snap_id)); + int do_cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl, + uint64_t snap_id) { + return TestMemIoCtxImpl::cmpext(oid, off, cmp_bl, snap_id); } - MOCK_METHOD7(exec, int(const std::string& oid, + MOCK_METHOD8(exec, int(const std::string& oid, TestClassHandler *handler, const char *cls, const char *method, bufferlist& inbl, bufferlist* outbl, + uint64_t snap_id, const SnapContext &snapc)); int do_exec(const std::string& oid, TestClassHandler *handler, const char *cls, const char *method, bufferlist& inbl, - bufferlist* outbl, const SnapContext &snapc) { + bufferlist* outbl, uint64_t snap_id, const SnapContext &snapc) { return TestMemIoCtxImpl::exec(oid, handler, cls, method, inbl, outbl, - snapc); + snap_id, snapc); } MOCK_CONST_METHOD0(get_instance_id, uint64_t()); @@ -121,23 +124,24 @@ public: void do_set_snap_read(snap_t snap_id) { return TestMemIoCtxImpl::set_snap_read(snap_id); } - MOCK_METHOD5(sparse_read, int(const std::string& oid, + MOCK_METHOD6(sparse_read, int(const std::string& oid, uint64_t off, uint64_t len, std::map *m, - bufferlist *bl)); + bufferlist *bl, uint64_t)); int do_sparse_read(const std::string& oid, uint64_t off, size_t len, - std::map *m, bufferlist *bl){ - return TestMemIoCtxImpl::sparse_read(oid, off, len, m, bl); + std::map *m, bufferlist *bl, + uint64_t snap_id) { + return TestMemIoCtxImpl::sparse_read(oid, off, len, m, bl, snap_id); } - MOCK_METHOD4(read, int(const std::string& oid, + MOCK_METHOD5(read, int(const std::string& oid, size_t len, uint64_t off, - bufferlist *bl)); + bufferlist *bl, uint64_t snap_id)); int do_read(const std::string& oid, size_t len, uint64_t off, - bufferlist *bl) { - return TestMemIoCtxImpl::read(oid, len, off, bl); + bufferlist *bl, uint64_t snap_id) { + return TestMemIoCtxImpl::read(oid, len, off, bl, snap_id); } MOCK_METHOD2(remove, int(const std::string& oid, const SnapContext &snapc)); @@ -208,17 +212,17 @@ public: ON_CALL(*this, aio_operate(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_operate)); ON_CALL(*this, aio_watch(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_watch)); ON_CALL(*this, aio_unwatch(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_aio_unwatch)); - ON_CALL(*this, assert_exists(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_assert_exists)); + ON_CALL(*this, assert_exists(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_assert_exists)); ON_CALL(*this, create(_, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_create)); - ON_CALL(*this, cmpext(_,_,_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_cmpext)); - ON_CALL(*this, exec(_, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec)); + ON_CALL(*this, cmpext(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_cmpext)); + ON_CALL(*this, exec(_, _, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec)); ON_CALL(*this, get_instance_id()).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_get_instance_id)); ON_CALL(*this, list_snaps(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_list_snaps)); ON_CALL(*this, list_watchers(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_list_watchers)); ON_CALL(*this, notify(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_notify)); - ON_CALL(*this, read(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_read)); + ON_CALL(*this, read(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_read)); ON_CALL(*this, set_snap_read(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_set_snap_read)); - ON_CALL(*this, sparse_read(_, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_sparse_read)); + ON_CALL(*this, sparse_read(_, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_sparse_read)); ON_CALL(*this, remove(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_remove)); ON_CALL(*this, selfmanaged_snap_create(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_selfmanaged_snap_create)); ON_CALL(*this, selfmanaged_snap_remove(_)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_selfmanaged_snap_remove)); diff --git a/src/test/librados_test_stub/TestClassHandler.cc b/src/test/librados_test_stub/TestClassHandler.cc index ef96f6198db9f..ff0441f30e05d 100644 --- a/src/test/librados_test_stub/TestClassHandler.cc +++ b/src/test/librados_test_stub/TestClassHandler.cc @@ -132,13 +132,14 @@ cls_method_cxx_call_t TestClassHandler::get_method(const std::string &cls, } TestClassHandler::SharedMethodContext TestClassHandler::get_method_context( - TestIoCtxImpl *io_ctx_impl, const std::string &oid, + TestIoCtxImpl *io_ctx_impl, const std::string &oid, uint64_t snap_id, const SnapContext &snapc) { SharedMethodContext ctx(new MethodContext()); // clone to ioctx to provide a firewall for gmock expectations ctx->io_ctx_impl = io_ctx_impl->clone(); ctx->oid = oid; + ctx->snap_id = snap_id; ctx->snapc = snapc; return ctx; } diff --git a/src/test/librados_test_stub/TestClassHandler.h b/src/test/librados_test_stub/TestClassHandler.h index df273364d3066..09e009bf8617a 100644 --- a/src/test/librados_test_stub/TestClassHandler.h +++ b/src/test/librados_test_stub/TestClassHandler.h @@ -27,6 +27,7 @@ public: TestIoCtxImpl *io_ctx_impl; std::string oid; + uint64_t snap_id; SnapContext snapc; }; typedef boost::shared_ptr SharedMethodContext; @@ -54,6 +55,7 @@ public: const std::string &method); SharedMethodContext get_method_context(TestIoCtxImpl *io_ctx_impl, const std::string &oid, + uint64_t snap_id, const SnapContext &snapc); int create_filter(cls_handle_t hclass, const std::string& filter_name, diff --git a/src/test/librados_test_stub/TestIoCtxImpl.cc b/src/test/librados_test_stub/TestIoCtxImpl.cc index 31a60ae2621ff..2aaf29d578b9a 100644 --- a/src/test/librados_test_stub/TestIoCtxImpl.cc +++ b/src/test/librados_test_stub/TestIoCtxImpl.cc @@ -111,7 +111,7 @@ int TestIoCtxImpl::aio_operate(const std::string& oid, TestObjectOperationImpl & m_pending_ops++; m_client->add_aio_operation(oid, true, boost::bind( &TestIoCtxImpl::execute_aio_operations, this, oid, &ops, - reinterpret_cast(0), + reinterpret_cast(0), m_snap_seq, snap_context != NULL ? *snap_context : m_snapc), c); return 0; } @@ -119,12 +119,13 @@ int TestIoCtxImpl::aio_operate(const std::string& oid, TestObjectOperationImpl & int TestIoCtxImpl::aio_operate_read(const std::string& oid, TestObjectOperationImpl &ops, AioCompletionImpl *c, int flags, - bufferlist *pbl) { + bufferlist *pbl, uint64_t snap_id) { // TODO ignoring flags for now ops.get(); m_pending_ops++; m_client->add_aio_operation(oid, true, boost::bind( - &TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl, m_snapc), c); + &TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl, snap_id, + m_snapc), c); return 0; } @@ -159,7 +160,7 @@ int TestIoCtxImpl::aio_unwatch(uint64_t handle, AioCompletionImpl *c) { int TestIoCtxImpl::exec(const std::string& oid, TestClassHandler *handler, const char *cls, const char *method, bufferlist& inbl, bufferlist* outbl, - const SnapContext &snapc) { + uint64_t snap_id, const SnapContext &snapc) { if (m_client->is_blacklisted()) { return -EBLACKLISTED; } @@ -170,7 +171,8 @@ int TestIoCtxImpl::exec(const std::string& oid, TestClassHandler *handler, } return (*call)(reinterpret_cast( - handler->get_method_context(this, oid, snapc).get()), &inbl, outbl); + handler->get_method_context(this, oid, snap_id, snapc).get()), &inbl, + outbl); } int TestIoCtxImpl::list_watchers(const std::string& o, @@ -201,14 +203,15 @@ void TestIoCtxImpl::notify_ack(const std::string& o, uint64_t notify_id, m_client->get_instance_id(), bl); } -int TestIoCtxImpl::operate(const std::string& oid, TestObjectOperationImpl &ops) { +int TestIoCtxImpl::operate(const std::string& oid, + TestObjectOperationImpl &ops) { AioCompletionImpl *comp = new AioCompletionImpl(); ops.get(); m_pending_ops++; m_client->add_aio_operation(oid, false, boost::bind( &TestIoCtxImpl::execute_aio_operations, this, oid, &ops, - reinterpret_cast(0), m_snapc), comp); + reinterpret_cast(0), m_snap_seq, m_snapc), comp); comp->wait_for_complete(); int ret = comp->get_return_value(); @@ -216,7 +219,8 @@ int TestIoCtxImpl::operate(const std::string& oid, TestObjectOperationImpl &ops) return ret; } -int TestIoCtxImpl::operate_read(const std::string& oid, TestObjectOperationImpl &ops, +int TestIoCtxImpl::operate_read(const std::string& oid, + TestObjectOperationImpl &ops, bufferlist *pbl) { AioCompletionImpl *comp = new AioCompletionImpl(); @@ -224,7 +228,7 @@ int TestIoCtxImpl::operate_read(const std::string& oid, TestObjectOperationImpl m_pending_ops++; m_client->add_aio_operation(oid, false, boost::bind( &TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl, - m_snapc), comp); + m_snap_seq, m_snapc), comp); comp->wait_for_complete(); int ret = comp->get_return_value(); @@ -287,7 +291,7 @@ int TestIoCtxImpl::tmap_update(const std::string& oid, bufferlist& cmdbl) { if (size > 0) { bufferlist inbl; - r = read(oid, size, 0, &inbl); + r = read(oid, size, 0, &inbl, CEPH_NOSNAP); if (r < 0) { return r; } @@ -357,7 +361,7 @@ int TestIoCtxImpl::execute_operation(const std::string& oid, int TestIoCtxImpl::execute_aio_operations(const std::string& oid, TestObjectOperationImpl *ops, - bufferlist *pbl, + bufferlist *pbl, uint64_t snap_id, const SnapContext &snapc) { int ret = 0; if (m_client->is_blacklisted()) { @@ -366,7 +370,7 @@ int TestIoCtxImpl::execute_aio_operations(const std::string& oid, TestRadosClient::Transaction transaction(m_client, get_namespace(), oid); for (ObjectOperations::iterator it = ops->ops.begin(); it != ops->ops.end(); ++it) { - ret = (*it)(this, oid, pbl, snapc); + ret = (*it)(this, oid, pbl, snap_id, snapc); if (ret < 0) { break; } diff --git a/src/test/librados_test_stub/TestIoCtxImpl.h b/src/test/librados_test_stub/TestIoCtxImpl.h index 0bd3e6fb0c248..8d8a07dfded59 100644 --- a/src/test/librados_test_stub/TestIoCtxImpl.h +++ b/src/test/librados_test_stub/TestIoCtxImpl.h @@ -22,6 +22,7 @@ class TestRadosClient; typedef boost::function ObjectOperationTestImpl; typedef std::list ObjectOperations; @@ -89,7 +90,7 @@ public: int flags); virtual int aio_operate_read(const std::string& oid, TestObjectOperationImpl &ops, AioCompletionImpl *c, int flags, - bufferlist *pbl); + bufferlist *pbl, uint64_t snap_id); virtual int aio_remove(const std::string& oid, AioCompletionImpl *c, int flags = 0) = 0; virtual int aio_watch(const std::string& o, AioCompletionImpl *c, @@ -97,14 +98,14 @@ public: virtual int aio_unwatch(uint64_t handle, AioCompletionImpl *c); virtual int append(const std::string& oid, const bufferlist &bl, const SnapContext &snapc) = 0; - virtual int assert_exists(const std::string &oid) = 0; + virtual int assert_exists(const std::string &oid, uint64_t snap_id) = 0; virtual int create(const std::string& oid, bool exclusive, const SnapContext &snapc) = 0; virtual int exec(const std::string& oid, TestClassHandler *handler, const char *cls, const char *method, bufferlist& inbl, bufferlist* outbl, - const SnapContext &snapc); + uint64_t snap_id, const SnapContext &snapc); virtual int list_snaps(const std::string& o, snap_set_t *out_snaps) = 0; virtual int list_watchers(const std::string& o, std::list *out_watchers); @@ -131,7 +132,7 @@ public: virtual int operate_read(const std::string& oid, TestObjectOperationImpl &ops, bufferlist *pbl); virtual int read(const std::string& oid, size_t len, uint64_t off, - bufferlist *bl) = 0; + bufferlist *bl, uint64_t snap_id) = 0; virtual int remove(const std::string& oid, const SnapContext &snapc) = 0; virtual int selfmanaged_snap_create(uint64_t *snapid) = 0; virtual void aio_selfmanaged_snap_create(uint64_t *snapid, @@ -151,7 +152,7 @@ public: virtual void set_snap_read(snap_t seq); virtual int sparse_read(const std::string& oid, uint64_t off, uint64_t len, std::map *m, - bufferlist *data_bl) = 0; + bufferlist *data_bl, uint64_t snap_id) = 0; virtual int stat(const std::string& oid, uint64_t *psize, time_t *pmtime) = 0; virtual int truncate(const std::string& oid, uint64_t size, const SnapContext &snapc) = 0; @@ -165,7 +166,8 @@ public: const SnapContext &snapc) = 0; virtual int writesame(const std::string& oid, bufferlist& bl, size_t len, uint64_t off, const SnapContext &snapc) = 0; - virtual int cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) = 0; + virtual int cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl, + uint64_t snap_id) = 0; virtual int xattr_get(const std::string& oid, std::map* attrset) = 0; virtual int xattr_set(const std::string& oid, const std::string &name, @@ -182,7 +184,8 @@ protected: int execute_aio_operations(const std::string& oid, TestObjectOperationImpl *ops, - bufferlist *pbl, const SnapContext &snapc); + bufferlist *pbl, uint64_t, + const SnapContext &snapc); private: struct C_AioNotify : public Context { diff --git a/src/test/librados_test_stub/TestMemIoCtxImpl.cc b/src/test/librados_test_stub/TestMemIoCtxImpl.cc index dae137b45430c..d1f2f8cda5120 100644 --- a/src/test/librados_test_stub/TestMemIoCtxImpl.cc +++ b/src/test/librados_test_stub/TestMemIoCtxImpl.cc @@ -76,7 +76,7 @@ int TestMemIoCtxImpl::append(const std::string& oid, const bufferlist &bl, TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, true, snapc); + file = get_file(oid, true, CEPH_NOSNAP, snapc); } std::unique_lock l{file->lock}; @@ -86,13 +86,13 @@ int TestMemIoCtxImpl::append(const std::string& oid, const bufferlist &bl, return 0; } -int TestMemIoCtxImpl::assert_exists(const std::string &oid) { +int TestMemIoCtxImpl::assert_exists(const std::string &oid, uint64_t snap_id) { if (m_client->is_blacklisted()) { return -EBLACKLISTED; } std::shared_lock l{m_pool->file_lock}; - TestMemCluster::SharedFile file = get_file(oid, false, get_snap_context()); + TestMemCluster::SharedFile file = get_file(oid, false, snap_id, {}); if (file == NULL) { return -ENOENT; } @@ -108,7 +108,7 @@ int TestMemIoCtxImpl::create(const std::string& oid, bool exclusive, } std::unique_lock l{m_pool->file_lock}; - get_file(oid, true, snapc); + get_file(oid, true, CEPH_NOSNAP, snapc); return 0; } @@ -198,7 +198,7 @@ int TestMemIoCtxImpl::omap_get_vals2(const std::string& oid, TestMemCluster::SharedFile file; { std::shared_lock l{m_pool->file_lock}; - file = get_file(oid, false, get_snap_context()); + file = get_file(oid, false, CEPH_NOSNAP, {}); if (file == NULL) { return -ENOENT; } @@ -255,7 +255,7 @@ int TestMemIoCtxImpl::omap_rm_keys(const std::string& oid, TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, true, get_snap_context()); + file = get_file(oid, true, CEPH_NOSNAP, get_snap_context()); if (file == NULL) { return -ENOENT; } @@ -280,7 +280,7 @@ int TestMemIoCtxImpl::omap_set(const std::string& oid, TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, true, get_snap_context()); + file = get_file(oid, true, CEPH_NOSNAP, get_snap_context()); if (file == NULL) { return -ENOENT; } @@ -298,7 +298,7 @@ int TestMemIoCtxImpl::omap_set(const std::string& oid, } int TestMemIoCtxImpl::read(const std::string& oid, size_t len, uint64_t off, - bufferlist *bl) { + bufferlist *bl, uint64_t snap_id) { if (m_client->is_blacklisted()) { return -EBLACKLISTED; } @@ -306,7 +306,7 @@ int TestMemIoCtxImpl::read(const std::string& oid, size_t len, uint64_t off, TestMemCluster::SharedFile file; { std::shared_lock l{m_pool->file_lock}; - file = get_file(oid, false, get_snap_context()); + file = get_file(oid, false, snap_id, {}); if (file == NULL) { return -ENOENT; } @@ -333,11 +333,11 @@ int TestMemIoCtxImpl::remove(const std::string& oid, const SnapContext &snapc) { } std::unique_lock l{m_pool->file_lock}; - TestMemCluster::SharedFile file = get_file(oid, false, snapc); + TestMemCluster::SharedFile file = get_file(oid, false, CEPH_NOSNAP, snapc); if (file == NULL) { return -ENOENT; } - file = get_file(oid, true, snapc); + file = get_file(oid, true, CEPH_NOSNAP, snapc); { std::unique_lock l2{file->lock}; @@ -455,7 +455,7 @@ int TestMemIoCtxImpl::set_alloc_hint(const std::string& oid, { std::unique_lock l{m_pool->file_lock}; - get_file(oid, true, snapc); + get_file(oid, true, CEPH_NOSNAP, snapc); } return 0; @@ -464,7 +464,7 @@ int TestMemIoCtxImpl::set_alloc_hint(const std::string& oid, int TestMemIoCtxImpl::sparse_read(const std::string& oid, uint64_t off, uint64_t len, std::map *m, - bufferlist *data_bl) { + bufferlist *data_bl, uint64_t snap_id) { if (m_client->is_blacklisted()) { return -EBLACKLISTED; } @@ -473,7 +473,7 @@ int TestMemIoCtxImpl::sparse_read(const std::string& oid, uint64_t off, TestMemCluster::SharedFile file; { std::shared_lock l{m_pool->file_lock}; - file = get_file(oid, false, get_snap_context()); + file = get_file(oid, false, snap_id, {}); if (file == NULL) { return -ENOENT; } @@ -505,7 +505,7 @@ int TestMemIoCtxImpl::stat(const std::string& oid, uint64_t *psize, TestMemCluster::SharedFile file; { std::shared_lock l{m_pool->file_lock}; - file = get_file(oid, false, get_snap_context()); + file = get_file(oid, false, CEPH_NOSNAP, {}); if (file == NULL) { return -ENOENT; } @@ -532,7 +532,7 @@ int TestMemIoCtxImpl::truncate(const std::string& oid, uint64_t size, TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, true, snapc); + file = get_file(oid, true, CEPH_NOSNAP, snapc); } std::unique_lock l{file->lock}; @@ -570,7 +570,7 @@ int TestMemIoCtxImpl::write(const std::string& oid, bufferlist& bl, size_t len, TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, true, snapc); + file = get_file(oid, true, CEPH_NOSNAP, snapc); } std::unique_lock l{file->lock}; @@ -597,7 +597,7 @@ int TestMemIoCtxImpl::write_full(const std::string& oid, bufferlist& bl, TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, true, snapc); + file = get_file(oid, true, CEPH_NOSNAP, snapc); if (file == NULL) { return -ENOENT; } @@ -617,8 +617,9 @@ int TestMemIoCtxImpl::write_full(const std::string& oid, bufferlist& bl, return 0; } -int TestMemIoCtxImpl::writesame(const std::string& oid, bufferlist& bl, size_t len, - uint64_t off, const SnapContext &snapc) { +int TestMemIoCtxImpl::writesame(const std::string& oid, bufferlist& bl, + size_t len, uint64_t off, + const SnapContext &snapc) { if (get_snap_read() != CEPH_NOSNAP) { return -EROFS; } else if (m_client->is_blacklisted()) { @@ -632,7 +633,7 @@ int TestMemIoCtxImpl::writesame(const std::string& oid, bufferlist& bl, size_t l TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, true, snapc); + file = get_file(oid, true, CEPH_NOSNAP, snapc); } std::unique_lock l{file->lock}; @@ -653,7 +654,7 @@ int TestMemIoCtxImpl::writesame(const std::string& oid, bufferlist& bl, size_t l } int TestMemIoCtxImpl::cmpext(const std::string& oid, uint64_t off, - bufferlist& cmp_bl) { + bufferlist& cmp_bl, uint64_t snap_id) { if (m_client->is_blacklisted()) { return -EBLACKLISTED; } @@ -664,7 +665,7 @@ int TestMemIoCtxImpl::cmpext(const std::string& oid, uint64_t off, TestMemCluster::SharedFile file; { std::shared_lock l{m_pool->file_lock}; - file = get_file(oid, false, get_snap_context()); + file = get_file(oid, false, snap_id, {}); if (file == NULL) { return cmpext_compare(cmp_bl, read_bl); } @@ -718,11 +719,11 @@ int TestMemIoCtxImpl::zero(const std::string& oid, uint64_t off, uint64_t len, TestMemCluster::SharedFile file; { std::unique_lock l{m_pool->file_lock}; - file = get_file(oid, false, snapc); + file = get_file(oid, false, CEPH_NOSNAP, snapc); if (!file) { return 0; } - file = get_file(oid, true, snapc); + file = get_file(oid, true, CEPH_NOSNAP, snapc); std::shared_lock l2{file->lock}; if (len > 0 && off + len >= file->data.length()) { @@ -768,7 +769,8 @@ void TestMemIoCtxImpl::ensure_minimum_length(size_t len, bufferlist *bl) { } TestMemCluster::SharedFile TestMemIoCtxImpl::get_file( - const std::string &oid, bool write, const SnapContext &snapc) { + const std::string &oid, bool write, uint64_t snap_id, + const SnapContext &snapc) { ceph_assert(ceph_mutex_is_locked(m_pool->file_lock) || ceph_mutex_is_wlocked(m_pool->file_lock)); ceph_assert(!write || ceph_mutex_is_wlocked(m_pool->file_lock)); @@ -817,7 +819,7 @@ TestMemCluster::SharedFile TestMemIoCtxImpl::get_file( return file; } - if (get_snap_read() == CEPH_NOSNAP) { + if (snap_id == CEPH_NOSNAP) { if (!file->exists) { ceph_assert(it->second.size() > 1); return TestMemCluster::SharedFile(); @@ -829,7 +831,7 @@ TestMemCluster::SharedFile TestMemIoCtxImpl::get_file( for (TestMemCluster::FileSnapshots::reverse_iterator it = snaps.rbegin(); it != snaps.rend(); ++it) { TestMemCluster::SharedFile file = *it; - if (file->snap_id < get_snap_read()) { + if (file->snap_id < snap_id) { if (!file->exists) { return TestMemCluster::SharedFile(); } diff --git a/src/test/librados_test_stub/TestMemIoCtxImpl.h b/src/test/librados_test_stub/TestMemIoCtxImpl.h index 712c57f8cc871..d4be453868f26 100644 --- a/src/test/librados_test_stub/TestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/TestMemIoCtxImpl.h @@ -26,7 +26,7 @@ public: int append(const std::string& oid, const bufferlist &bl, const SnapContext &snapc) override; - int assert_exists(const std::string &oid) override; + int assert_exists(const std::string &oid, uint64_t snap_id) override; int create(const std::string& oid, bool exclusive, const SnapContext &snapc) override; @@ -47,7 +47,7 @@ public: int omap_set(const std::string& oid, const std::map &map) override; int read(const std::string& oid, size_t len, uint64_t off, - bufferlist *bl) override; + bufferlist *bl, uint64_t snap_id) override; int remove(const std::string& oid, const SnapContext &snapc) override; int selfmanaged_snap_create(uint64_t *snapid) override; int selfmanaged_snap_remove(uint64_t snapid) override; @@ -57,7 +57,8 @@ public: uint64_t expected_write_size, uint32_t flags, const SnapContext &snapc) override; int sparse_read(const std::string& oid, uint64_t off, uint64_t len, - std::map *m, bufferlist *data_bl) override; + std::map *m, bufferlist *data_bl, + uint64_t snap_id) override; int stat(const std::string& oid, uint64_t *psize, time_t *pmtime) override; int truncate(const std::string& oid, uint64_t size, const SnapContext &snapc) override; @@ -67,7 +68,8 @@ public: const SnapContext &snapc) override; int writesame(const std::string& oid, bufferlist& bl, size_t len, uint64_t off, const SnapContext &snapc) override; - int cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) override; + int cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl, + uint64_t snap_id) override; int xattr_get(const std::string& oid, std::map* attrset) override; int xattr_set(const std::string& oid, const std::string &name, @@ -91,6 +93,7 @@ private: void ensure_minimum_length(size_t len, bufferlist *bl); TestMemCluster::SharedFile get_file(const std::string &oid, bool write, + uint64_t snap_id, const SnapContext &snapc); }; diff --git a/src/test/librbd/deep_copy/test_mock_MetadataCopyRequest.cc b/src/test/librbd/deep_copy/test_mock_MetadataCopyRequest.cc index a44cd4cda3eaa..d18e79f2c4dd9 100644 --- a/src/test/librbd/deep_copy/test_mock_MetadataCopyRequest.cc +++ b/src/test/librbd/deep_copy/test_mock_MetadataCopyRequest.cc @@ -110,7 +110,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("metadata_set"), ContentsEqual(in_bl), _, _)) + StrEq("metadata_set"), ContentsEqual(in_bl), _, _, _)) .WillOnce(Return(r)); } }; diff --git a/src/test/librbd/deep_copy/test_mock_ObjectCopyRequest.cc b/src/test/librbd/deep_copy/test_mock_ObjectCopyRequest.cc index 03de245f151a9..085b838917ed8 100644 --- a/src/test/librbd/deep_copy/test_mock_ObjectCopyRequest.cc +++ b/src/test/librbd/deep_copy/test_mock_ObjectCopyRequest.cc @@ -220,7 +220,8 @@ public: void expect_sparse_read(librados::MockTestMemIoCtxImpl &mock_io_ctx, uint64_t offset, uint64_t length, int r) { - auto &expect = EXPECT_CALL(mock_io_ctx, sparse_read(_, offset, length, _, _)); + auto &expect = EXPECT_CALL(mock_io_ctx, sparse_read(_, offset, length, _, _, + _)); if (r < 0) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/deep_copy/test_mock_SetHeadRequest.cc b/src/test/librbd/deep_copy/test_mock_SetHeadRequest.cc index f044f55e0c7a7..d8442d84b01ab 100644 --- a/src/test/librbd/deep_copy/test_mock_SetHeadRequest.cc +++ b/src/test/librbd/deep_copy/test_mock_SetHeadRequest.cc @@ -119,7 +119,8 @@ public: void expect_set_size(librbd::MockTestImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("set_size"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("set_size"), _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/deep_copy/test_mock_SnapshotCreateRequest.cc b/src/test/librbd/deep_copy/test_mock_SnapshotCreateRequest.cc index b192e3f1a6f37..01b55af04fd4a 100644 --- a/src/test/librbd/deep_copy/test_mock_SnapshotCreateRequest.cc +++ b/src/test/librbd/deep_copy/test_mock_SnapshotCreateRequest.cc @@ -122,7 +122,8 @@ public: std::string oid(librbd::ObjectMap<>::object_map_name(mock_image_ctx.id, snap_id)); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, _)) + exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, _, + _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/image/test_mock_AttachChildRequest.cc b/src/test/librbd/image/test_mock_AttachChildRequest.cc index 100d2da2457de..66d594eb02542 100644 --- a/src/test/librbd/image/test_mock_AttachChildRequest.cc +++ b/src/test/librbd/image/test_mock_AttachChildRequest.cc @@ -92,7 +92,8 @@ public: void expect_add_child(MockImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(RBD_CHILDREN, _, StrEq("rbd"), StrEq("add_child"), _, _, _)) + exec(RBD_CHILDREN, _, StrEq("rbd"), StrEq("add_child"), _, _, _, + _)) .WillOnce(Return(r)); } @@ -119,7 +120,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(util::header_name(mock_image_ctx.id), _, StrEq("rbd"), - StrEq("op_features_set"), ContentsEqual(bl), _, _)) + StrEq("op_features_set"), ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } @@ -131,7 +132,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("child_attach"), ContentsEqual(bl), _, _)) + StrEq("child_attach"), ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/image/test_mock_AttachParentRequest.cc b/src/test/librbd/image/test_mock_AttachParentRequest.cc index c8c6ca71bccb1..de5f644310b53 100644 --- a/src/test/librbd/image/test_mock_AttachParentRequest.cc +++ b/src/test/librbd/image/test_mock_AttachParentRequest.cc @@ -45,14 +45,14 @@ public: void expect_parent_attach(MockImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("parent_attach"), _, _, _)) + StrEq("parent_attach"), _, _, _, _)) .WillOnce(Return(r)); } void expect_set_parent(MockImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("set_parent"), _, _, _)) + StrEq("set_parent"), _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/image/test_mock_CloneRequest.cc b/src/test/librbd/image/test_mock_CloneRequest.cc index 1745a96335ca7..1a0524e568982 100644 --- a/src/test/librbd/image/test_mock_CloneRequest.cc +++ b/src/test/librbd/image/test_mock_CloneRequest.cc @@ -332,7 +332,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"), - _, _, _)) + _, _, _, _)) .WillOnce(WithArg<5>(Invoke([out_bl, r](bufferlist* out) { *out = out_bl; return r; diff --git a/src/test/librbd/image/test_mock_DetachChildRequest.cc b/src/test/librbd/image/test_mock_DetachChildRequest.cc index cd62099c00ff9..f160305a0071d 100644 --- a/src/test/librbd/image/test_mock_DetachChildRequest.cc +++ b/src/test/librbd/image/test_mock_DetachChildRequest.cc @@ -130,14 +130,14 @@ public: EXPECT_CALL(mock_io_ctx_impl, exec(util::header_name(parent_spec.image_id), _, StrEq("rbd"), StrEq("child_detach"), ContentsEqual(bl), - _, _)) + _, _, _)) .WillOnce(Return(r)); } void expect_remove_child(MockImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(RBD_CHILDREN, _, StrEq("rbd"), StrEq("remove_child"), _, - _, _)) + _, _, _)) .WillOnce(Return(r)); } @@ -149,7 +149,7 @@ public: using ceph::encode; EXPECT_CALL(mock_io_ctx_impl, exec(parent_header_name, _, StrEq("rbd"), - StrEq("snapshot_get"), _, _, _)) + StrEq("snapshot_get"), _, _, _, _)) .WillOnce(WithArg<5>(Invoke([snap_info, r](bufferlist* bl) { encode(snap_info, *bl); return r; @@ -194,7 +194,7 @@ public: using ceph::encode; EXPECT_CALL(mock_io_ctx_impl, exec(RBD_TRASH, _, StrEq("rbd"), - StrEq("trash_get"), _, _, _)) + StrEq("trash_get"), _, _, _, _)) .WillOnce(WithArg<5>(Invoke([trash_spec, r](bufferlist* bl) { encode(trash_spec, *bl); return r; diff --git a/src/test/librbd/image/test_mock_DetachParentRequest.cc b/src/test/librbd/image/test_mock_DetachParentRequest.cc index 3d7a0e3250397..4d9f012f8239c 100644 --- a/src/test/librbd/image/test_mock_DetachParentRequest.cc +++ b/src/test/librbd/image/test_mock_DetachParentRequest.cc @@ -45,14 +45,14 @@ public: void expect_parent_detach(MockImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("parent_detach"), _, _, _)) + StrEq("parent_detach"), _, _, _, _)) .WillOnce(Return(r)); } void expect_remove_parent(MockImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("remove_parent"), _, _, _)) + StrEq("remove_parent"), _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/image/test_mock_PreRemoveRequest.cc b/src/test/librbd/image/test_mock_PreRemoveRequest.cc index 08c6eb1627caf..a451104f882fc 100644 --- a/src/test/librbd/image/test_mock_PreRemoveRequest.cc +++ b/src/test/librbd/image/test_mock_PreRemoveRequest.cc @@ -183,7 +183,7 @@ public: auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("image_group_get"), _, _, _)); + StrEq("image_group_get"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/image/test_mock_RefreshRequest.cc b/src/test/librbd/image/test_mock_RefreshRequest.cc index 93f30186406c4..68c17d42ae322 100644 --- a/src/test/librbd/image/test_mock_RefreshRequest.cc +++ b/src/test/librbd/image/test_mock_RefreshRequest.cc @@ -196,7 +196,7 @@ public: void expect_v1_read_header(MockRefreshImageCtx &mock_image_ctx, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - read(mock_image_ctx.header_oid, _, _, _)); + read(mock_image_ctx.header_oid, _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -206,7 +206,8 @@ public: void expect_v1_get_snapshots(MockRefreshImageCtx &mock_image_ctx, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("snap_list"), _, _, _)); + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("snap_list"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -216,7 +217,8 @@ public: void expect_v1_get_locks(MockRefreshImageCtx &mock_image_ctx, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("lock"), StrEq("get_info"), _, _, _)); + exec(mock_image_ctx.header_oid, _, StrEq("lock"), + StrEq("get_info"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -227,7 +229,8 @@ public: void expect_get_mutable_metadata(MockRefreshImageCtx &mock_image_ctx, uint64_t features, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_size"), _, _, _)); + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_size"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -237,7 +240,8 @@ public: expect.WillOnce(DoDefault()); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_features"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_features"), _, _, _, _)) .WillOnce(WithArg<5>(Invoke([features, incompatible](bufferlist* out_bl) { encode(features, *out_bl); encode(incompatible, *out_bl); @@ -245,10 +249,12 @@ public: }))); expect_get_flags(mock_image_ctx, 0); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_snapcontext"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_snapcontext"), _, _, _, _)) .WillOnce(DoDefault()); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("lock"), StrEq("get_info"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("lock"), + StrEq("get_info"), _, _, _, _)) .WillOnce(DoDefault()); } } @@ -256,7 +262,7 @@ public: void expect_parent_overlap_get(MockRefreshImageCtx &mock_image_ctx, int r) { auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("parent_overlap_get"), _, _, _)); + StrEq("parent_overlap_get"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -267,7 +273,7 @@ public: void expect_get_parent(MockRefreshImageCtx &mock_image_ctx, int r) { auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("parent_get"), _, _, _)); + StrEq("parent_get"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -279,7 +285,7 @@ public: void expect_get_parent_legacy(MockRefreshImageCtx &mock_image_ctx, int r) { auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("get_parent"), _, _, _)); + StrEq("get_parent"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -290,7 +296,7 @@ public: void expect_get_migration_header(MockRefreshImageCtx &mock_image_ctx, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("migration_get"), _, _, _)); + StrEq("migration_get"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -313,7 +319,8 @@ public: void expect_get_flags(MockRefreshImageCtx &mock_image_ctx, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_flags"), _, _, _)); + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_flags"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -325,7 +332,7 @@ public: uint64_t op_features, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("op_features_get"), _, _, _)) + StrEq("op_features_get"), _, _, _, _)) .WillOnce(WithArg<5>(Invoke([op_features, r](bufferlist* out_bl) { encode(op_features, *out_bl); return r; @@ -335,7 +342,7 @@ public: void expect_get_group(MockRefreshImageCtx &mock_image_ctx, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("image_group_get"), _, _, _)); + StrEq("image_group_get"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -346,21 +353,24 @@ public: void expect_get_snapshots(MockRefreshImageCtx &mock_image_ctx, bool legacy_parent, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("snapshot_get"), _, _, _)); + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("snapshot_get"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { expect.WillOnce(DoDefault()); if (legacy_parent) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_parent"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_parent"), _, _, _, _)) .WillOnce(DoDefault()); } else { expect_parent_overlap_get(mock_image_ctx, 0); } expect_get_flags(mock_image_ctx, 0); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_protection_status"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_protection_status"), _, _, _, _)) .WillOnce(DoDefault()); } } @@ -368,25 +378,30 @@ public: void expect_get_snapshots_legacy(MockRefreshImageCtx &mock_image_ctx, bool include_timestamp, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_snapshot_name"), _, _, _)); + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_snapshot_name"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { expect.WillOnce(DoDefault()); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_size"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_size"), _, _, _, _)) .WillOnce(DoDefault()); if (include_timestamp) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_snapshot_timestamp"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_snapshot_timestamp"), _, _, _, _)) .WillOnce(DoDefault()); } EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_parent"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_parent"), _, _, _, _)) .WillOnce(DoDefault()); expect_get_flags(mock_image_ctx, 0); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("get_protection_status"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("get_protection_status"), _, _, _, _)) .WillOnce(DoDefault()); } } diff --git a/src/test/librbd/image/test_mock_RemoveRequest.cc b/src/test/librbd/image/test_mock_RemoveRequest.cc index d6359ff32740e..9a6e8abdb00de 100644 --- a/src/test/librbd/image/test_mock_RemoveRequest.cc +++ b/src/test/librbd/image/test_mock_RemoveRequest.cc @@ -291,15 +291,15 @@ public: void expect_remove_mirror_image(librados::IoCtx &ioctx, int r) { EXPECT_CALL(get_mock_io_ctx(ioctx), - exec(StrEq("rbd_mirroring"), _, StrEq("rbd"), StrEq("mirror_image_remove"), - _, _, _)) + exec(StrEq("rbd_mirroring"), _, StrEq("rbd"), + StrEq("mirror_image_remove"), _, _, _, _)) .WillOnce(Return(r)); } void expect_dir_remove_image(librados::IoCtx &ioctx, int r) { EXPECT_CALL(get_mock_io_ctx(ioctx), exec(RBD_DIRECTORY, _, StrEq("rbd"), StrEq("dir_remove_image"), - _, _, _)) + _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/image/test_mock_ValidatePoolRequest.cc b/src/test/librbd/image/test_mock_ValidatePoolRequest.cc index e40e50af0adc5..7bb3ead9db92b 100644 --- a/src/test/librbd/image/test_mock_ValidatePoolRequest.cc +++ b/src/test/librbd/image/test_mock_ValidatePoolRequest.cc @@ -52,7 +52,7 @@ public: void expect_read_rbd_info(librados::MockTestMemIoCtxImpl &mock_io_ctx, const std::string& data, int r) { - auto& expect = EXPECT_CALL(mock_io_ctx, read(StrEq(RBD_INFO), 0, 0, _)); + auto& expect = EXPECT_CALL(mock_io_ctx, read(StrEq(RBD_INFO), 0, 0, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/io/test_mock_CopyupRequest.cc b/src/test/librbd/io/test_mock_CopyupRequest.cc index 96a08615161da..ec8cdf651eebd 100644 --- a/src/test/librbd/io/test_mock_CopyupRequest.cc +++ b/src/test/librbd/io/test_mock_CopyupRequest.cc @@ -219,7 +219,7 @@ struct TestMockIoCopyupRequest : public TestMockFixture { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.data_ctx), exec(oid, _, StrEq("rbd"), StrEq("copyup"), - ContentsEqual(in_bl), _, snapc)) + ContentsEqual(in_bl), _, _, snapc)) .WillOnce(Return(r)); } @@ -241,7 +241,7 @@ struct TestMockIoCopyupRequest : public TestMockFixture { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.data_ctx), exec(oid, _, StrEq("rbd"), StrEq("sparse_copyup"), - ContentsEqual(in_bl), _, snapc)) + ContentsEqual(in_bl), _, _, snapc)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/io/test_mock_ObjectRequest.cc b/src/test/librbd/io/test_mock_ObjectRequest.cc index b963d737704da..0ca7e9b800d02 100644 --- a/src/test/librbd/io/test_mock_ObjectRequest.cc +++ b/src/test/librbd/io/test_mock_ObjectRequest.cc @@ -150,7 +150,7 @@ struct TestMockIoObjectRequest : public TestMockFixture { bl.append(data); auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.data_ctx), - read(oid, len, off, _)); + read(oid, len, off, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -168,7 +168,7 @@ struct TestMockIoObjectRequest : public TestMockFixture { bl.append(data); auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.data_ctx), - sparse_read(oid, off, len, _, _)); + sparse_read(oid, off, len, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -225,7 +225,8 @@ struct TestMockIoObjectRequest : public TestMockFixture { } void expect_assert_exists(MockTestImageCtx &mock_image_ctx, int r) { - EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.data_ctx), assert_exists(_)) + EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.data_ctx), + assert_exists(_, _)) .WillOnce(Return(r)); } @@ -299,7 +300,7 @@ struct TestMockIoObjectRequest : public TestMockFixture { void expect_cmpext(MockTestImageCtx &mock_image_ctx, int offset, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.data_ctx), - cmpext(_, offset, _)); + cmpext(_, offset, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/managed_lock/test_mock_AcquireRequest.cc b/src/test/librbd/managed_lock/test_mock_AcquireRequest.cc index 6e42d95bb7e27..92b7b61a0e4d9 100644 --- a/src/test/librbd/managed_lock/test_mock_AcquireRequest.cc +++ b/src/test/librbd/managed_lock/test_mock_AcquireRequest.cc @@ -120,7 +120,7 @@ public: bool exclusive = true) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("lock"), - StrEq("lock"), IsLockType(exclusive), _, _)) + StrEq("lock"), IsLockType(exclusive), _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/managed_lock/test_mock_BreakRequest.cc b/src/test/librbd/managed_lock/test_mock_BreakRequest.cc index d47799c6d7685..5a9940e49e42e 100644 --- a/src/test/librbd/managed_lock/test_mock_BreakRequest.cc +++ b/src/test/librbd/managed_lock/test_mock_BreakRequest.cc @@ -113,7 +113,8 @@ public: void expect_break_lock(MockTestImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("lock"), StrEq("break_lock"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("lock"), + StrEq("break_lock"), _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc b/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc index 1850526a7fc2a..8cad1f09258c5 100644 --- a/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc +++ b/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc @@ -52,7 +52,7 @@ public: ClsLockType lock_type) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("lock"), - StrEq("get_info"), _, _, _)); + StrEq("get_info"), _, _, _, _)); if (r < 0 && r != -ENOENT) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/managed_lock/test_mock_ReacquireRequest.cc b/src/test/librbd/managed_lock/test_mock_ReacquireRequest.cc index e295f8fc3d962..ec63925acc16d 100644 --- a/src/test/librbd/managed_lock/test_mock_ReacquireRequest.cc +++ b/src/test/librbd/managed_lock/test_mock_ReacquireRequest.cc @@ -46,7 +46,7 @@ public: bool exclusive = true) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("lock"), - StrEq("set_cookie"), IsLockType(exclusive), _, _)) + StrEq("set_cookie"), IsLockType(exclusive), _, _, _)) .WillOnce(Return(r)); } }; diff --git a/src/test/librbd/managed_lock/test_mock_ReleaseRequest.cc b/src/test/librbd/managed_lock/test_mock_ReleaseRequest.cc index af75f8f296365..63752475e1359 100644 --- a/src/test/librbd/managed_lock/test_mock_ReleaseRequest.cc +++ b/src/test/librbd/managed_lock/test_mock_ReleaseRequest.cc @@ -41,7 +41,7 @@ public: void expect_unlock(MockImageCtx &mock_image_ctx, int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("lock"), - StrEq("unlock"), _, _, _)) + StrEq("unlock"), _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/mirror/snapshot/test_mock_CreateNonPrimaryRequest.cc b/src/test/librbd/mirror/snapshot/test_mock_CreateNonPrimaryRequest.cc index 6649d24479aa5..d7e70cab7649b 100644 --- a/src/test/librbd/mirror/snapshot/test_mock_CreateNonPrimaryRequest.cc +++ b/src/test/librbd/mirror/snapshot/test_mock_CreateNonPrimaryRequest.cc @@ -129,7 +129,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), - _, _, _)) + _, _, _, _)) .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)), Return(r))); } @@ -149,7 +149,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_peer_list"), - _, _, _)) + _, _, _, _)) .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)), Return(r))); } diff --git a/src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc b/src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc index 3babd19d23288..f38e58d8e8738 100644 --- a/src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc +++ b/src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc @@ -140,7 +140,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_peer_list"), - _, _, _)) + _, _, _, _)) .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)), Return(r))); } diff --git a/src/test/librbd/mirror/snapshot/test_mock_ImageMeta.cc b/src/test/librbd/mirror/snapshot/test_mock_ImageMeta.cc index 9bc6139d83e76..70a5eaeb0a860 100644 --- a/src/test/librbd/mirror/snapshot/test_mock_ImageMeta.cc +++ b/src/test/librbd/mirror/snapshot/test_mock_ImageMeta.cc @@ -49,7 +49,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("metadata_get"), ContentsEqual(in_bl), _, _)) + StrEq("metadata_get"), ContentsEqual(in_bl), _, _, _)) .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(out_bl)), Return(r))); } @@ -68,7 +68,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("metadata_set"), ContentsEqual(in_bl), _, _)) + StrEq("metadata_set"), ContentsEqual(in_bl), _, _, _)) .WillOnce(Return(r)); } }; diff --git a/src/test/librbd/mirror/snapshot/test_mock_UnlinkPeerRequest.cc b/src/test/librbd/mirror/snapshot/test_mock_UnlinkPeerRequest.cc index eba9b5cbf3fea..2492e06f9bd20 100644 --- a/src/test/librbd/mirror/snapshot/test_mock_UnlinkPeerRequest.cc +++ b/src/test/librbd/mirror/snapshot/test_mock_UnlinkPeerRequest.cc @@ -85,7 +85,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("mirror_image_snapshot_unlink_peer"), - ContentsEqual(bl), _, _)) + ContentsEqual(bl), _, _, _)) .WillOnce(Invoke([&mock_image_ctx, snap_id, peer_uuid, r](auto&&... args) -> int { if (r == 0) { auto it = mock_image_ctx.snap_info.find(snap_id); diff --git a/src/test/librbd/mirror/test_mock_DisableRequest.cc b/src/test/librbd/mirror/test_mock_DisableRequest.cc index 95c8927772aed..823884fe588f9 100644 --- a/src/test/librbd/mirror/test_mock_DisableRequest.cc +++ b/src/test/librbd/mirror/test_mock_DisableRequest.cc @@ -228,7 +228,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(::journal::Journaler::header_oid(mock_image_ctx.id), - _, StrEq("journal"), StrEq("client_list"), _, _, _)) + _, StrEq("journal"), StrEq("client_list"), _, _, _, _)) .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)), Return(r))); } @@ -243,7 +243,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(::journal::Journaler::header_oid(mock_image_ctx.id), _, StrEq("journal"), StrEq("client_unregister"), - ContentsEqual(bl), _, _)) + ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/librbd/object_map/test_mock_InvalidateRequest.cc b/src/test/librbd/object_map/test_mock_InvalidateRequest.cc index 5cefe6fae0f30..4867c4e2321e6 100644 --- a/src/test/librbd/object_map/test_mock_InvalidateRequest.cc +++ b/src/test/librbd/object_map/test_mock_InvalidateRequest.cc @@ -36,7 +36,8 @@ TEST_F(TestMockObjectMapInvalidateRequest, UpdatesInMemoryFlag) { AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, false, &cond_ctx); EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, + _, _)) .Times(0); { @@ -62,7 +63,8 @@ TEST_F(TestMockObjectMapInvalidateRequest, UpdatesHeadOnDiskFlag) { AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, false, &cond_ctx); EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, + _, _)) .WillOnce(DoDefault()); { @@ -91,7 +93,8 @@ TEST_F(TestMockObjectMapInvalidateRequest, UpdatesSnapOnDiskFlag) { &cond_ctx); EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, + _, _)) .WillOnce(DoDefault()); { @@ -112,7 +115,8 @@ TEST_F(TestMockObjectMapInvalidateRequest, SkipOnDiskUpdateWithoutLock) { AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, false, &cond_ctx); EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, + _, _)) .Times(0); { @@ -136,7 +140,8 @@ TEST_F(TestMockObjectMapInvalidateRequest, IgnoresOnDiskUpdateFailure) { AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, false, &cond_ctx); EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, + _, _)) .WillOnce(Return(-EINVAL)); { diff --git a/src/test/librbd/object_map/test_mock_LockRequest.cc b/src/test/librbd/object_map/test_mock_LockRequest.cc index 5f95429acd2ed..a99cab61efee5 100644 --- a/src/test/librbd/object_map/test_mock_LockRequest.cc +++ b/src/test/librbd/object_map/test_mock_LockRequest.cc @@ -30,7 +30,7 @@ public: std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id, CEPH_NOSNAP)); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(oid, _, StrEq("lock"), StrEq("lock"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("lock"), _, _, _, _)) .WillOnce(Return(r)); } @@ -38,7 +38,8 @@ public: std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id, CEPH_NOSNAP)); auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(oid, _, StrEq("lock"), StrEq("get_info"), _, _, _)); + exec(oid, _, StrEq("lock"), StrEq("get_info"), _, + _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -64,7 +65,8 @@ public: std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id, CEPH_NOSNAP)); auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(oid, _, StrEq("lock"), StrEq("break_lock"), _, _, _)); + exec(oid, _, StrEq("lock"), StrEq("break_lock"), + _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/object_map/test_mock_RefreshRequest.cc b/src/test/librbd/object_map/test_mock_RefreshRequest.cc index f7dffb61eebbb..43d9c3b43caa1 100644 --- a/src/test/librbd/object_map/test_mock_RefreshRequest.cc +++ b/src/test/librbd/object_map/test_mock_RefreshRequest.cc @@ -88,7 +88,8 @@ public: int r) { std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id, snap_id)); auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(oid, _, StrEq("rbd"), StrEq("object_map_load"), _, _, _)); + exec(oid, _, StrEq("rbd"), + StrEq("object_map_load"), _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -129,7 +130,8 @@ public: std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id, TEST_SNAP_ID)); auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, _)); + exec(oid, _, StrEq("rbd"), + StrEq("object_map_resize"), _, _, _, _)); expect.WillOnce(Return(r)); } diff --git a/src/test/librbd/object_map/test_mock_ResizeRequest.cc b/src/test/librbd/object_map/test_mock_ResizeRequest.cc index 1ca85258848d4..d6a3dd91ce689 100644 --- a/src/test/librbd/object_map/test_mock_ResizeRequest.cc +++ b/src/test/librbd/object_map/test_mock_ResizeRequest.cc @@ -26,24 +26,28 @@ public: std::string oid(ObjectMap<>::object_map_name(ictx->id, snap_id)); if (snap_id == CEPH_NOSNAP) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _, + _)) .WillOnce(DoDefault()); } if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, _)) + exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, + _, _)) .WillOnce(Return(r)); } else { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, _)) + exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, + _, _)) .WillOnce(DoDefault()); } } void expect_invalidate(librbd::ImageCtx *ictx) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, + _, _, _)) .WillOnce(DoDefault()); } }; diff --git a/src/test/librbd/object_map/test_mock_SnapshotCreateRequest.cc b/src/test/librbd/object_map/test_mock_SnapshotCreateRequest.cc index 74ac7732b90d8..ed3658c51eba7 100644 --- a/src/test/librbd/object_map/test_mock_SnapshotCreateRequest.cc +++ b/src/test/librbd/object_map/test_mock_SnapshotCreateRequest.cc @@ -33,11 +33,11 @@ public: if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), read(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP), - 0, 0, _)).WillOnce(Return(r)); + 0, 0, _, _)).WillOnce(Return(r)); } else { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), read(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP), - 0, 0, _)).WillOnce(DoDefault()); + 0, 0, _, _)).WillOnce(DoDefault()); } } @@ -59,21 +59,25 @@ public: std::string oid(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP)); if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _, + _)) .WillOnce(Return(r)); } else { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _, + _)) .WillOnce(DoDefault()); EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("rbd"), StrEq("object_map_snap_add"), _, _, _)) + exec(oid, _, StrEq("rbd"), StrEq("object_map_snap_add"), _, _, + _, _)) .WillOnce(DoDefault()); } } void expect_invalidate(librbd::ImageCtx *ictx) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, + _, _, _)) .WillOnce(DoDefault()); } }; diff --git a/src/test/librbd/object_map/test_mock_SnapshotRemoveRequest.cc b/src/test/librbd/object_map/test_mock_SnapshotRemoveRequest.cc index f02d3d3e70da8..20318743d30dc 100644 --- a/src/test/librbd/object_map/test_mock_SnapshotRemoveRequest.cc +++ b/src/test/librbd/object_map/test_mock_SnapshotRemoveRequest.cc @@ -26,11 +26,13 @@ public: std::string snap_oid(ObjectMap<>::object_map_name(ictx->id, snap_id)); if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _, _, _)) + exec(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _, + _, _, _)) .WillOnce(Return(r)); } else { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _, _, _)) + exec(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _, + _, _, _)) .WillOnce(DoDefault()); } } @@ -39,14 +41,17 @@ public: std::string oid(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP)); if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _, + _)) .WillOnce(Return(r)); } else { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _, + _)) .WillOnce(DoDefault()); EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("rbd"), StrEq("object_map_snap_remove"), _, _, _)) + exec(oid, _, StrEq("rbd"), StrEq("object_map_snap_remove"), _, + _, _, _)) .WillOnce(DoDefault()); } } @@ -64,7 +69,8 @@ public: void expect_invalidate(librbd::ImageCtx *ictx) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, + _, _, _)) .WillOnce(DoDefault()); } }; diff --git a/src/test/librbd/object_map/test_mock_SnapshotRollbackRequest.cc b/src/test/librbd/object_map/test_mock_SnapshotRollbackRequest.cc index 92f3847ca07fb..96636ab14d025 100644 --- a/src/test/librbd/object_map/test_mock_SnapshotRollbackRequest.cc +++ b/src/test/librbd/object_map/test_mock_SnapshotRollbackRequest.cc @@ -25,18 +25,18 @@ public: if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), read(ObjectMap<>::object_map_name(ictx->id, snap_id), - 0, 0, _)).WillOnce(Return(r)); + 0, 0, _, _)).WillOnce(Return(r)); } else { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), read(ObjectMap<>::object_map_name(ictx->id, snap_id), - 0, 0, _)).WillOnce(DoDefault()); + 0, 0, _, _)).WillOnce(DoDefault()); } } void expect_write_map(librbd::ImageCtx *ictx, int r) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), exec(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP), _, - StrEq("lock"), StrEq("assert_locked"), _, _, _)) + StrEq("lock"), StrEq("assert_locked"), _, _, _, _)) .WillOnce(DoDefault()); if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), @@ -53,7 +53,8 @@ public: void expect_invalidate(librbd::ImageCtx *ictx, uint32_t times) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, + _, _, _)) .Times(times) .WillRepeatedly(DoDefault()); } diff --git a/src/test/librbd/object_map/test_mock_UnlockRequest.cc b/src/test/librbd/object_map/test_mock_UnlockRequest.cc index 95879c88748f2..f91ee001d0f7e 100644 --- a/src/test/librbd/object_map/test_mock_UnlockRequest.cc +++ b/src/test/librbd/object_map/test_mock_UnlockRequest.cc @@ -28,7 +28,7 @@ public: std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id, CEPH_NOSNAP)); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(oid, _, StrEq("lock"), StrEq("unlock"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("unlock"), _, _, _, _)) .WillOnce(Return(r)); } }; diff --git a/src/test/librbd/object_map/test_mock_UpdateRequest.cc b/src/test/librbd/object_map/test_mock_UpdateRequest.cc index 42b3a5360bfe0..20683ac6957ea 100644 --- a/src/test/librbd/object_map/test_mock_UpdateRequest.cc +++ b/src/test/librbd/object_map/test_mock_UpdateRequest.cc @@ -38,26 +38,28 @@ public: std::string oid(ObjectMap<>::object_map_name(ictx->id, snap_id)); if (snap_id == CEPH_NOSNAP) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _)) + exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _, + _)) .WillOnce(DoDefault()); } if (r < 0) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), exec(oid, _, StrEq("rbd"), StrEq("object_map_update"), - ContentsEqual(bl), _, _)) + ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } else { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), exec(oid, _, StrEq("rbd"), StrEq("object_map_update"), - ContentsEqual(bl), _, _)) + ContentsEqual(bl), _, _, _)) .WillOnce(DoDefault()); } } void expect_invalidate(librbd::ImageCtx *ictx) { EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx), - exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _, _)) + exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, + _, _, _)) .WillOnce(DoDefault()); } }; diff --git a/src/test/librbd/operation/test_mock_ResizeRequest.cc b/src/test/librbd/operation/test_mock_ResizeRequest.cc index 707bdf458135f..7c5fb54620905 100644 --- a/src/test/librbd/operation/test_mock_ResizeRequest.cc +++ b/src/test/librbd/operation/test_mock_ResizeRequest.cc @@ -141,7 +141,8 @@ public: } else { expect_is_lock_owner(mock_image_ctx); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("set_size"), _, _, _)) + exec(mock_image_ctx.header_oid, _, StrEq("rbd"), + StrEq("set_size"), _, _, _, _)) .WillOnce(Return(r)); } } diff --git a/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc b/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc index cf56f9e298040..fb0b1f1dc48f0 100644 --- a/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc @@ -105,7 +105,7 @@ public: exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq(mock_image_ctx.old_format ? "snap_add" : "snapshot_add"), - _, _, _)); + _, _, _, _)); if (r == -ESTALE) { expect.WillOnce(Return(r)).WillOnce(DoDefault()); } else if (r < 0) { diff --git a/src/test/librbd/operation/test_mock_SnapshotProtectRequest.cc b/src/test/librbd/operation/test_mock_SnapshotProtectRequest.cc index b2d56912ee349..aa8c1e78dc7e8 100644 --- a/src/test/librbd/operation/test_mock_SnapshotProtectRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotProtectRequest.cc @@ -48,7 +48,8 @@ public: void expect_set_protection_status(MockImageCtx &mock_image_ctx, int r) { auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("set_protection_status"), _, _, _)); + StrEq("set_protection_status"), _, _, _, + _)); if (r < 0) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc b/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc index 74c0108300dd1..886ac768e74b2 100644 --- a/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc @@ -121,7 +121,7 @@ public: auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("snapshot_trash_add"), - _, _, _)); + _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -138,7 +138,7 @@ public: using ceph::encode; EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("snapshot_get"), _, _, _)) + StrEq("snapshot_get"), _, _, _, _)) .WillOnce(WithArg<5>(Invoke([snap_info, r](bufferlist* bl) { encode(snap_info, *bl); return r; @@ -154,7 +154,7 @@ public: using ceph::encode; EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("children_list"), _, _, _)) + StrEq("children_list"), _, _, _, _)) .WillOnce(WithArg<5>(Invoke([child_images, r](bufferlist* bl) { encode(child_images, *bl); return r; @@ -171,7 +171,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(util::header_name(parent_spec.image_id), _, StrEq("rbd"), StrEq("child_detach"), ContentsEqual(bl), - _, _)) + _, _, _)) .WillOnce(Return(r)); } @@ -217,7 +217,7 @@ public: exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq(mock_image_ctx.old_format ? "snap_remove" : "snapshot_remove"), - _, _, _)); + _, _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { diff --git a/src/test/librbd/operation/test_mock_SnapshotUnprotectRequest.cc b/src/test/librbd/operation/test_mock_SnapshotUnprotectRequest.cc index cad664486d652..26b1be2066a28 100644 --- a/src/test/librbd/operation/test_mock_SnapshotUnprotectRequest.cc +++ b/src/test/librbd/operation/test_mock_SnapshotUnprotectRequest.cc @@ -56,8 +56,8 @@ public: auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(mock_image_ctx.header_oid, _, StrEq("rbd"), - StrEq("set_protection_status"), ContentsEqual(bl), - _, _)); + StrEq("set_protection_status"), + ContentsEqual(bl), _, _, _)); if (r < 0) { expect.WillOnce(Return(r)); } else { @@ -90,8 +90,8 @@ public: encode(children, bl); auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), - exec(RBD_CHILDREN, _, StrEq("rbd"), StrEq("get_children"), _, - _, _)); + exec(RBD_CHILDREN, _, StrEq("rbd"), + StrEq("get_children"), _, _, _, _)); if (r < 0) { expect.WillRepeatedly(Return(r)); } else { diff --git a/src/test/librbd/test_mock_fixture.cc b/src/test/librbd/test_mock_fixture.cc index 0a467c1613733..166175c9bd441 100644 --- a/src/test/librbd/test_mock_fixture.cc +++ b/src/test/librbd/test_mock_fixture.cc @@ -53,7 +53,7 @@ void TestMockFixture::TearDown() { void TestMockFixture::expect_unlock_exclusive_lock(librbd::ImageCtx &ictx) { EXPECT_CALL(get_mock_io_ctx(ictx.md_ctx), - exec(_, _, StrEq("lock"), StrEq("unlock"), _, _, _)) + exec(_, _, StrEq("lock"), StrEq("unlock"), _, _, _, _)) .WillRepeatedly(DoDefault()); } diff --git a/src/test/librbd/trash/test_mock_MoveRequest.cc b/src/test/librbd/trash/test_mock_MoveRequest.cc index 7bd7dbfcb678b..1a35c62ae600b 100644 --- a/src/test/librbd/trash/test_mock_MoveRequest.cc +++ b/src/test/librbd/trash/test_mock_MoveRequest.cc @@ -62,7 +62,7 @@ struct TestMockTrashMoveRequest : public TestMockFixture { int r) { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_add"), - _, _, _)) + _, _, _, _)) .WillOnce(WithArg<4>(Invoke([=](bufferlist& in_bl) { std::string id; cls::rbd::TrashImageSpec trash_image_spec; @@ -96,7 +96,7 @@ struct TestMockTrashMoveRequest : public TestMockFixture { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(StrEq("rbd_directory"), _, StrEq("rbd"), StrEq("dir_remove_image"), - ContentsEqual(in_bl), _, _)) + ContentsEqual(in_bl), _, _, _)) .WillOnce(Return(r)); } }; diff --git a/src/test/librbd/trash/test_mock_RemoveRequest.cc b/src/test/librbd/trash/test_mock_RemoveRequest.cc index 407855ae77ce7..2e75b3ac5b8f1 100644 --- a/src/test/librbd/trash/test_mock_RemoveRequest.cc +++ b/src/test/librbd/trash/test_mock_RemoveRequest.cc @@ -103,7 +103,7 @@ struct TestMockTrashRemoveRequest : public TestMockFixture { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_state_set"), - ContentsEqual(in_bl), _, _)) + ContentsEqual(in_bl), _, _, _)) .WillOnce(Return(r)); } @@ -140,7 +140,7 @@ struct TestMockTrashRemoveRequest : public TestMockFixture { EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_remove"), - ContentsEqual(in_bl), _, _)) + ContentsEqual(in_bl), _, _, _)) .WillOnce(Return(r)); } }; diff --git a/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc b/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc index ae481dce4e294..c85fb150014e0 100644 --- a/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc +++ b/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc @@ -201,7 +201,8 @@ public: encode(image_id, bl); EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), - exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get_image_id"), _, _, _)) + exec(RBD_MIRRORING, _, StrEq("rbd"), + StrEq("mirror_image_get_image_id"), _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) { *out_bl = bl; })), @@ -272,14 +273,14 @@ public: EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), - StrEq("mirror_image_set"), ContentsEqual(bl), _, _)) + StrEq("mirror_image_set"), ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } void expect_mirror_image_remove(librados::IoCtx &ioctx, int r) { EXPECT_CALL(get_mock_io_ctx(ioctx), - exec(StrEq("rbd_mirroring"), _, StrEq("rbd"), StrEq("mirror_image_remove"), - _, _, _)) + exec(StrEq("rbd_mirroring"), _, StrEq("rbd"), + StrEq("mirror_image_remove"), _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/rbd_mirror/image_deleter/test_mock_TrashRemoveRequest.cc b/src/test/rbd_mirror/image_deleter/test_mock_TrashRemoveRequest.cc index 43057cce0489c..f69a74f64da2a 100644 --- a/src/test/rbd_mirror/image_deleter/test_mock_TrashRemoveRequest.cc +++ b/src/test/rbd_mirror/image_deleter/test_mock_TrashRemoveRequest.cc @@ -134,7 +134,7 @@ public: using ceph::encode; EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), exec(StrEq(RBD_TRASH), _, StrEq("rbd"), - StrEq("trash_get"), _, _, _)) + StrEq("trash_get"), _, _, _, _)) .WillOnce(WithArg<5>(Invoke([trash_spec, r](bufferlist* bl) { encode(trash_spec, *bl); return r; @@ -150,7 +150,7 @@ public: EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), exec(StrEq(RBD_TRASH), _, StrEq("rbd"), StrEq("trash_state_set"), - ContentsEqual(in_bl), _, _)) + ContentsEqual(in_bl), _, _, _)) .WillOnce(Return(r)); } @@ -161,7 +161,7 @@ public: EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), exec(librbd::util::header_name(image_id), _, StrEq("rbd"), - StrEq("get_snapcontext"), _, _, _)) + StrEq("get_snapcontext"), _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) { *out_bl = bl; })), diff --git a/src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc b/src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc index a3961d9f6a6fa..bd434b85f511f 100644 --- a/src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc +++ b/src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc @@ -169,7 +169,7 @@ public: EXPECT_CALL(get_mock_io_ctx(io_ctx), exec(RBD_TRASH, _, StrEq("rbd"), StrEq("trash_list"), - ContentsEqual(bl), _, _)) + ContentsEqual(bl), _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([out_bl](bufferlist *bl) { *bl = out_bl; })), diff --git a/src/test/rbd_mirror/image_replayer/snapshot/test_mock_ApplyImageStateRequest.cc b/src/test/rbd_mirror/image_replayer/snapshot/test_mock_ApplyImageStateRequest.cc index f937024eaf5d7..904d3685485d9 100644 --- a/src/test/rbd_mirror/image_replayer/snapshot/test_mock_ApplyImageStateRequest.cc +++ b/src/test/rbd_mirror/image_replayer/snapshot/test_mock_ApplyImageStateRequest.cc @@ -128,7 +128,7 @@ public: ceph::encode(key, bl); EXPECT_CALL(get_mock_io_ctx(m_mock_local_image_ctx->md_ctx), exec(m_mock_local_image_ctx->header_oid, _, StrEq("rbd"), - StrEq("metadata_remove"), ContentsEqual(bl), _, _)) + StrEq("metadata_remove"), ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); if (r < 0) { return; @@ -140,7 +140,7 @@ public: ceph::encode(pairs, bl); EXPECT_CALL(get_mock_io_ctx(m_mock_local_image_ctx->md_ctx), exec(m_mock_local_image_ctx->header_oid, _, StrEq("rbd"), - StrEq("metadata_set"), ContentsEqual(bl), _, _)) + StrEq("metadata_set"), ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } } diff --git a/src/test/rbd_mirror/image_replayer/snapshot/test_mock_CreateLocalImageRequest.cc b/src/test/rbd_mirror/image_replayer/snapshot/test_mock_CreateLocalImageRequest.cc index 74e385a808436..58214f3e8f8ab 100644 --- a/src/test/rbd_mirror/image_replayer/snapshot/test_mock_CreateLocalImageRequest.cc +++ b/src/test/rbd_mirror/image_replayer/snapshot/test_mock_CreateLocalImageRequest.cc @@ -170,7 +170,7 @@ public: EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), - StrEq("mirror_image_set"), ContentsEqual(bl), _, _)) + StrEq("mirror_image_set"), ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } @@ -181,7 +181,7 @@ public: EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), exec(StrEq("rbd_mirroring"), _, StrEq("rbd"), StrEq("mirror_image_remove"), - ContentsEqual(bl), _, _)) + ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc b/src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc index d1117bb79eb6f..f9550dcb5b421 100644 --- a/src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc +++ b/src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc @@ -580,7 +580,7 @@ public: EXPECT_CALL(get_mock_io_ctx(mock_test_image_ctx.md_ctx), exec(mock_test_image_ctx.header_oid, _, StrEq("rbd"), StrEq("mirror_image_snapshot_set_copy_progress"), - ContentsEqual(bl), _, _)) + ContentsEqual(bl), _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc b/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc index c87173d271b11..ed2cf8f96e436 100644 --- a/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc +++ b/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc @@ -274,7 +274,8 @@ public: encode(mirror_image, bl); EXPECT_CALL(get_mock_io_ctx(io_ctx), - exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), _, _, _)) + exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), + _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) { *out_bl = bl; })), @@ -287,7 +288,8 @@ public: encode(image_id, bl); EXPECT_CALL(get_mock_io_ctx(io_ctx), - exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get_image_id"), _, _, _)) + exec(RBD_MIRRORING, _, StrEq("rbd"), + StrEq("mirror_image_get_image_id"), _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) { *out_bl = bl; })), diff --git a/src/test/rbd_mirror/image_replayer/test_mock_GetMirrorImageIdRequest.cc b/src/test/rbd_mirror/image_replayer/test_mock_GetMirrorImageIdRequest.cc index 40007dfda987d..4a238d282a9fd 100644 --- a/src/test/rbd_mirror/image_replayer/test_mock_GetMirrorImageIdRequest.cc +++ b/src/test/rbd_mirror/image_replayer/test_mock_GetMirrorImageIdRequest.cc @@ -49,7 +49,8 @@ public: encode(image_id, bl); EXPECT_CALL(get_mock_io_ctx(io_ctx), - exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get_image_id"), _, _, _)) + exec(RBD_MIRRORING, _, StrEq("rbd"), + StrEq("mirror_image_get_image_id"), _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) { *out_bl = bl; })), diff --git a/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc b/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc index a53f01fd2c98e..0b0a87e8de52d 100644 --- a/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc +++ b/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc @@ -198,7 +198,8 @@ public: encode(image_name, bl); EXPECT_CALL(get_mock_io_ctx(io_ctx), - exec(RBD_DIRECTORY, _, StrEq("rbd"), StrEq("dir_get_name"), _, _, _)) + exec(RBD_DIRECTORY, _, StrEq("rbd"), StrEq("dir_get_name"), _, + _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) { *out_bl = bl; })), diff --git a/src/test/rbd_mirror/pool_watcher/test_mock_RefreshImagesRequest.cc b/src/test/rbd_mirror/pool_watcher/test_mock_RefreshImagesRequest.cc index afabcdfc27ad8..3347a6cd4be72 100644 --- a/src/test/rbd_mirror/pool_watcher/test_mock_RefreshImagesRequest.cc +++ b/src/test/rbd_mirror/pool_watcher/test_mock_RefreshImagesRequest.cc @@ -47,7 +47,8 @@ public: encode(ids, bl); EXPECT_CALL(get_mock_io_ctx(io_ctx), - exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_list"), _, _, _)) + exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_list"), + _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) { *out_bl = bl; })), diff --git a/src/test/rbd_mirror/test_mock_InstanceWatcher.cc b/src/test/rbd_mirror/test_mock_InstanceWatcher.cc index 7b06424b702b2..7920edde48cd1 100644 --- a/src/test/rbd_mirror/test_mock_InstanceWatcher.cc +++ b/src/test/rbd_mirror/test_mock_InstanceWatcher.cc @@ -165,14 +165,14 @@ public: void expect_register_instance(librados::MockTestMemIoCtxImpl &mock_io_ctx, int r) { EXPECT_CALL(mock_io_ctx, exec(RBD_MIRROR_LEADER, _, StrEq("rbd"), - StrEq("mirror_instances_add"), _, _, _)) + StrEq("mirror_instances_add"), _, _, _, _)) .WillOnce(Return(r)); } void expect_unregister_instance(librados::MockTestMemIoCtxImpl &mock_io_ctx, int r) { EXPECT_CALL(mock_io_ctx, exec(RBD_MIRROR_LEADER, _, StrEq("rbd"), - StrEq("mirror_instances_remove"), _, _, _)) + StrEq("mirror_instances_remove"), _, _, _, _)) .WillOnce(Return(r)); } diff --git a/src/test/rbd_mirror/test_mock_MirrorStatusUpdater.cc b/src/test/rbd_mirror/test_mock_MirrorStatusUpdater.cc index 09805f78976c6..057159ceb4b88 100644 --- a/src/test/rbd_mirror/test_mock_MirrorStatusUpdater.cc +++ b/src/test/rbd_mirror/test_mock_MirrorStatusUpdater.cc @@ -151,7 +151,7 @@ public: const cls::rbd::MirrorImageSiteStatus& mirror_image_status, int r) { EXPECT_CALL(*m_mock_local_io_ctx, exec(RBD_MIRRORING, _, StrEq("rbd"), - StrEq("mirror_image_status_set"), _, _, _)) + StrEq("mirror_image_status_set"), _, _, _, _)) .WillOnce(WithArg<4>(Invoke( [r, global_image_id, mirror_image_status](bufferlist& in_bl) { auto bl_it = in_bl.cbegin(); diff --git a/src/test/rbd_mirror/test_mock_PoolReplayer.cc b/src/test/rbd_mirror/test_mock_PoolReplayer.cc index 42e5a42a6ea8b..0e2d44c4aab91 100644 --- a/src/test/rbd_mirror/test_mock_PoolReplayer.cc +++ b/src/test/rbd_mirror/test_mock_PoolReplayer.cc @@ -332,7 +332,7 @@ public: EXPECT_CALL(*io_ctx_impl, exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_uuid_get"), - _, _, _)) + _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([out_bl](bufferlist *bl) { *bl = out_bl; })), @@ -346,7 +346,7 @@ public: EXPECT_CALL(*io_ctx_impl, exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"), - _, _, _)) + _, _, _, _)) .WillOnce(DoAll(WithArg<5>(Invoke([out_bl](bufferlist *bl) { *bl = out_bl; })), @@ -356,7 +356,7 @@ public: void expect_mirror_mode_get(librados::MockTestMemIoCtxImpl *io_ctx_impl) { EXPECT_CALL(*io_ctx_impl, exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"), - _, _, _)) + _, _, _, _)) .WillRepeatedly(DoAll(WithArg<5>(Invoke([](bufferlist *bl) { encode(cls::rbd::MIRROR_MODE_POOL, *bl); })), -- 2.39.5