]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados_test_stub: pass read snap id to read operation hooks
authorJason Dillaman <dillaman@redhat.com>
Thu, 9 Jul 2020 15:58:31 +0000 (11:58 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 16 Jul 2020 19:59:31 +0000 (15:59 -0400)
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 <dillaman@redhat.com>
63 files changed:
src/test/librados_test_stub/LibradosTestStub.cc
src/test/librados_test_stub/MockTestMemIoCtxImpl.h
src/test/librados_test_stub/TestClassHandler.cc
src/test/librados_test_stub/TestClassHandler.h
src/test/librados_test_stub/TestIoCtxImpl.cc
src/test/librados_test_stub/TestIoCtxImpl.h
src/test/librados_test_stub/TestMemIoCtxImpl.cc
src/test/librados_test_stub/TestMemIoCtxImpl.h
src/test/librbd/deep_copy/test_mock_MetadataCopyRequest.cc
src/test/librbd/deep_copy/test_mock_ObjectCopyRequest.cc
src/test/librbd/deep_copy/test_mock_SetHeadRequest.cc
src/test/librbd/deep_copy/test_mock_SnapshotCreateRequest.cc
src/test/librbd/image/test_mock_AttachChildRequest.cc
src/test/librbd/image/test_mock_AttachParentRequest.cc
src/test/librbd/image/test_mock_CloneRequest.cc
src/test/librbd/image/test_mock_DetachChildRequest.cc
src/test/librbd/image/test_mock_DetachParentRequest.cc
src/test/librbd/image/test_mock_PreRemoveRequest.cc
src/test/librbd/image/test_mock_RefreshRequest.cc
src/test/librbd/image/test_mock_RemoveRequest.cc
src/test/librbd/image/test_mock_ValidatePoolRequest.cc
src/test/librbd/io/test_mock_CopyupRequest.cc
src/test/librbd/io/test_mock_ObjectRequest.cc
src/test/librbd/managed_lock/test_mock_AcquireRequest.cc
src/test/librbd/managed_lock/test_mock_BreakRequest.cc
src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc
src/test/librbd/managed_lock/test_mock_ReacquireRequest.cc
src/test/librbd/managed_lock/test_mock_ReleaseRequest.cc
src/test/librbd/mirror/snapshot/test_mock_CreateNonPrimaryRequest.cc
src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc
src/test/librbd/mirror/snapshot/test_mock_ImageMeta.cc
src/test/librbd/mirror/snapshot/test_mock_UnlinkPeerRequest.cc
src/test/librbd/mirror/test_mock_DisableRequest.cc
src/test/librbd/object_map/test_mock_InvalidateRequest.cc
src/test/librbd/object_map/test_mock_LockRequest.cc
src/test/librbd/object_map/test_mock_RefreshRequest.cc
src/test/librbd/object_map/test_mock_ResizeRequest.cc
src/test/librbd/object_map/test_mock_SnapshotCreateRequest.cc
src/test/librbd/object_map/test_mock_SnapshotRemoveRequest.cc
src/test/librbd/object_map/test_mock_SnapshotRollbackRequest.cc
src/test/librbd/object_map/test_mock_UnlockRequest.cc
src/test/librbd/object_map/test_mock_UpdateRequest.cc
src/test/librbd/operation/test_mock_ResizeRequest.cc
src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc
src/test/librbd/operation/test_mock_SnapshotProtectRequest.cc
src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc
src/test/librbd/operation/test_mock_SnapshotUnprotectRequest.cc
src/test/librbd/test_mock_fixture.cc
src/test/librbd/trash/test_mock_MoveRequest.cc
src/test/librbd/trash/test_mock_RemoveRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashRemoveRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc
src/test/rbd_mirror/image_replayer/snapshot/test_mock_ApplyImageStateRequest.cc
src/test/rbd_mirror/image_replayer/snapshot/test_mock_CreateLocalImageRequest.cc
src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc
src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_GetMirrorImageIdRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc
src/test/rbd_mirror/pool_watcher/test_mock_RefreshImagesRequest.cc
src/test/rbd_mirror/test_mock_InstanceWatcher.cc
src/test/rbd_mirror/test_mock_MirrorStatusUpdater.cc
src/test/rbd_mirror/test_mock_PoolReplayer.cc

index 93d0e3bb92fae22b4eafedd67504e6e8957adf50..1a920603039bad638dac4ed2d8d2b803a03e2886 100644 (file)
@@ -428,7 +428,8 @@ int IoCtx::aio_operate(const std::string& oid, AioCompletion *c,
                        bufferlist *pbl) {
   TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
   TestObjectOperationImpl *ops = reinterpret_cast<TestObjectOperationImpl*>(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<TestIoCtxImpl*>(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<TestIoCtxImpl*>(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<uint64_t,uint64_t>& m,
                        bufferlist& bl, size_t len, uint64_t off) {
   TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(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<TestIoCtxImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<obj_watch_t> *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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<std::string, bufferlist> &map) {
@@ -925,7 +932,7 @@ void ObjectWriteOperation::omap_set(const std::map<std::string, bufferlist> &map
 
 void ObjectWriteOperation::remove() {
   TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<TestObjectOperationImpl*>(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<librados::TestClassHandler::MethodContext*>(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,
index fc86c287fe98cc6109ce2c254927caa1720bbebb..765af67367f1525011f40822738bbf93c0875bcd 100644 (file)
@@ -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<uint64_t, uint64_t> *m,
-                               bufferlist *bl));
+                               bufferlist *bl, uint64_t));
   int do_sparse_read(const std::string& oid, uint64_t off, size_t len,
-                     std::map<uint64_t, uint64_t> *m, bufferlist *bl){
-     return TestMemIoCtxImpl::sparse_read(oid, off, len, m, bl);
+                     std::map<uint64_t, uint64_t> *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));
index ef96f6198db9f00e95c8de2068aaa3b87802a4fa..ff0441f30e05d0cde3db5e14163fc3bb5a7b1902 100644 (file)
@@ -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;
 }
index df273364d30665dfeb08bcf87d3bf86a89eb7b66..09e009bf8617a4635e94469455fea83c7f0f7edc 100644 (file)
@@ -27,6 +27,7 @@ public:
 
     TestIoCtxImpl *io_ctx_impl;
     std::string oid;
+    uint64_t snap_id;
     SnapContext snapc;
   };
   typedef boost::shared_ptr<MethodContext> 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,
index 31a60ae2621ffcecb58634e8e01128f77994ef42..2aaf29d578b9a67f3e9012357bfaebec00e926c6 100644 (file)
@@ -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<bufferlist*>(0),
+    reinterpret_cast<bufferlist*>(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<cls_method_context_t>(
-    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<bufferlist*>(0), m_snapc), comp);
+    reinterpret_cast<bufferlist*>(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;
       }
index 0bd3e6fb0c248ae25d00ab1d20beab86458f30ea..8d8a07dfded59c426e06397adf572d4d394df7e2 100644 (file)
@@ -22,6 +22,7 @@ class TestRadosClient;
 typedef boost::function<int(TestIoCtxImpl*,
                            const std::string&,
                            bufferlist *,
+                            uint64_t,
                             const SnapContext &)> ObjectOperationTestImpl;
 typedef std::list<ObjectOperationTestImpl> 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<obj_watch_t> *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<uint64_t,uint64_t> *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<std::string, bufferlist>* 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 {
index dae137b45430c3a60984f44a69bc073ca5ab7202..d1f2f8cda512010ad22edf9dc63da21eec2799b2 100644 (file)
@@ -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<uint64_t,uint64_t> *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();
       }
index 712c57f8cc871e09f9d18300cb24ceb50d09ccd7..d4be453868f268b8df63cef173e0e449fb344262 100644 (file)
@@ -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<std::string,
                bufferlist> &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<uint64_t,uint64_t> *m, bufferlist *data_bl) override;
+                  std::map<uint64_t,uint64_t> *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<std::string, bufferlist>* 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);
 
 };
index a44cd4cda3eaa65242c099aafaf2a1b08ceb228b..d18e79f2c4dd9353a21bbe71b71407b8aa2c9f14 100644 (file)
@@ -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));
   }
 };
index 03de245f151a9fff0e6c0286b5d189bbb7b1309d..085b838917ed8667c97648c731db0a86f888955e 100644 (file)
@@ -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 {
index f044f55e0c7a7b1e52c8d9e9c8bfb59ffb92138f..d8442d84b01ab24d0c3eb1e10339f513f1096ce2 100644 (file)
@@ -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));
   }
 
index b192e3f1a6f3726fcbc5f1610ae83ab284d38856..01b55af04fd4a606439063aa8db9809d99edea3b 100644 (file)
@@ -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));
   }
 
index 100d2da2457de888369cf95e195b78d4c6267e61..66d594eb02542d55c3522431dcb34ab93842b511 100644 (file)
@@ -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));
   }
 
index c8c6ca71bccb17693b26d2854d04b2a38f58dc7f..de5f644310b53d773bcf85c5fe2713d42834ae39 100644 (file)
@@ -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));
   }
 
index 1745a96335ca7caef7cdfc97c890930e78f4bddf..1a0524e56898266473484d600483180de29df72d 100644 (file)
@@ -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;
index cd62099c00ff9f87e748942fa1b8fa7b9a0bf382..f160305a0071d531f4ef4fe9c8415d3f0b53bdb3 100644 (file)
@@ -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;
index 3d7a0e3250397d0797c51a37c6b47af471390533..4d9f012f8239c9853f803fe3bcfe73e84bbca67e 100644 (file)
@@ -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));
   }
 
index 08c6eb1627caf2d568c726e4e5d3f0a432f70278..a451104f882fc15fd29f9ea60a4978e775b6c1a8 100644 (file)
@@ -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 {
index 93f30186406c44bc598496d72ebc17e31a6792e7..68c17d42ae32283207873d1ec9e22fe575521de5 100644 (file)
@@ -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());
     }
   }
index d6359ff32740e34aca081777c5a21c1a08da1d26..9a6e8abdb00de83b4a35915912f5f5f633f3e118 100644 (file)
@@ -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));
   }
 
index e40e50af0adc5be17b5b86a38423372454d20aaa..7bb3ead9db92b6d266f927bd0e60f90ce71aefbf 100644 (file)
@@ -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 {
index 96a08615161dae251de7dd683e69861d3fa93b98..ec8cdf651eebdc65e99d9cb769a0c9e3ab42fc23 100644 (file)
@@ -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));
   }
 
index b963d737704da4547c7eab00c39b92ea2ca6bcd3..0ca7e9b800d028282b627428b2f6081a20b4918d 100644 (file)
@@ -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 {
index 6e42d95bb7e27e344b8afa890af759e363ca48d4..92b7b61a0e4d9e77b4e046745cd2e3caccdc811c 100644 (file)
@@ -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));
   }
 
index d47799c6d7685d310524700bc1a045f16dd5f4be..5a9940e49e42e3bb63f250d76a11a546a5665ffa 100644 (file)
@@ -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));
   }
 
index 1850526a7fc2ae43ad2c9e87f5b0e535ce51920e..8cad1f09258c55422b78c690ca1d1bad02ad3692 100644 (file)
@@ -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 {
index e295f8fc3d962136618deee1cccb3691cdfe08a8..ec63925acc16d54252c7a6c020132a8c05902d42 100644 (file)
@@ -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));
   }
 };
index af75f8f296365f1f52ebe41c065b765d15bf9557..63752475e13593866b92a4577431dc7b35c12573 100644 (file)
@@ -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));
   }
 
index 6649d24479aa5dbf45645bcdad9e9c02fb158715..d7e70cab7649befb05c4a76ba9f8521241a8a912 100644 (file)
@@ -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)));
   }
index 3babd19d2328828dac8f73e5e68fc238cb28b4ec..f38e58d8e87387fa71b29d77013bd0e1e465468a 100644 (file)
@@ -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)));
   }
index 9bc6139d83e763138565e96a543464ac0d861ce2..70a5eaeb0a86026a0e7321e97fa1afdd4f6f7e1a 100644 (file)
@@ -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));
   }
 };
index eba9b5cbf3feaca304b40657430ce96f8edb34e6..2492e06f9bd200f0ede17dc3122937340e42e34a 100644 (file)
@@ -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);
index 95c8927772aed0344ee0dbb6585029104287abb9..823884fe588f93d637739022003243cdf51f085d 100644 (file)
@@ -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));
   }
 
index 5cefe6fae0f302c616bcf166d4b8060e210dc7b0..4867c4e2321e6bb9fc6884b1a789760a82678b22 100644 (file)
@@ -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));
 
   {
index 5f95429acd2ed9dfa01521e41bc017535ac1d904..a99cab61efee5f564d77f640c350ebff85fa437e 100644 (file)
@@ -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 {
index f7dffb61eebbbe54b681fa240a87183e702a65c7..43d9c3b43caa13e150dbdb97a2cc5206c8fa493f 100644 (file)
@@ -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));
   }
 
index 1ca85258848d42d721a7b9391b25c1cd9b03f033..d6a3dd91ce6892d649993a3facefd58342c2f21e 100644 (file)
@@ -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());
   }
 };
index 74ac7732b90d8e7ad95de4428a09b5668f987690..ed3658c51eba7c138f29be87c72a78c1f431f959 100644 (file)
@@ -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());
   }
 };
index f02d3d3e70da862883a74e99f700cd275db97ae9..20318743d30dcc64337eff0aee9e4299302d8382 100644 (file)
@@ -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());
   }
 };
index 92f3847ca07fb6f84651d16eece716dcc1bd1aa8..96636ab14d02566c480eb750235e368e50b95785 100644 (file)
@@ -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());
   }
index 95879c88748f238579419e139361bb234d5a3d54..f91ee001d0f7e6295f34c4030dd485688e5c46c7 100644 (file)
@@ -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));
   }
 };
index 42b3a5360bfe0a51c5a3293728d9f4bb95c63dd5..20683ac6957ea8b1de650c2d41827b87f3497674 100644 (file)
@@ -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());
   }
 };
index 707bdf458135fcc25c6bcdba354e37d0b8a920ea..7c5fb546209058f6bcbfcdebfcf51d5279b36d9f 100644 (file)
@@ -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));
     }
   }
index cf56f9e298040d2efa5c75920793f8062c600f7d..fb0b1f1dc48f0747d21ab76216f0d1eddd21c4f4 100644 (file)
@@ -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) {
index b2d56912ee349cb062444007e90deae0d22c1085..aa8c1e78dc7e8de3d938b0eac5cc5c035b5908d3 100644 (file)
@@ -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 {
index 74c0108300dd17907a8d1537eac5e61ef4c5985e..886ac768e74b2ad8223ff9c5cdd0e41effb2e260 100644 (file)
@@ -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 {
index cad664486d652051ec76f689d1831e9f0def59d1..26b1be2066a28f826021e2ad5a16e7b8e7a3915d 100644 (file)
@@ -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 {
index 0a467c1613733ccd7c2c46435a44d53969862638..166175c9bd44165c900fd1a8cfdd566648f3f398 100644 (file)
@@ -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());
 }
 
index 7bd7dbfcb678bf3ddd2d43c72dde70457c58d722..1a35c62ae600bcef50dfc20fa7abac2c6cd3fefa 100644 (file)
@@ -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));
   }
 };
index 407855ae77ce79a83a4885ecc08a5f7e94a784d9..2e75b3ac5b8f1f927ca956685926b1ede711cf0d 100644 (file)
@@ -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));
   }
 };
index ae481dce4e2948b08829af793f550160d0ae5a65..c85fb150014e08256e00c303c951e6e0da0e959c 100644 (file)
@@ -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));
   }
 
index 43057cce0489cb1852ede16c2c3ed9a263fce37f..f69a74f64da2a85cf5b689d749072f83401ece37 100644 (file)
@@ -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;
                                         })),
index a3961d9f6a6fa621aee5643f43a005b6ecafa3e2..bd434b85f511ff10a8d8cd6ef8e4dd5e396f64da 100644 (file)
@@ -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;
                         })),
index f937024eaf5d7056d25296d5e2cdd3d2c321c272..904d3685485d9b99aa2f504210ad6d4a7b070177 100644 (file)
@@ -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));
     }
   }
index 74e385a808436dcfb487c318dceee6992a9f0ef9..58214f3e8f8ab597315903105d6dba72047513fa 100644 (file)
@@ -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));
   }
 
index d1117bb79eb6f8b2f1731b3044f15018788c67f9..f9550dcb5b4213b15ce9165e2fac1e62b3a6d3c6 100644 (file)
@@ -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));
   }
 
index c87173d271b1105060071d265e208f611fd8c9ea..ed2cf8f96e4365f3aa180bb7a1145c9daa3fd226 100644 (file)
@@ -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;
                                         })),
index 40007dfda987d217539152e4ff7270979dd1d547..4a238d282a9fd4b0a53561dade82163a89da69f2 100644 (file)
@@ -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;
                                         })),
index a53f01fd2c98e5f46b5da8c592e369c2510745b6..0b0a87e8de52d2b5980e18e4caddfe32f4523d7b 100644 (file)
@@ -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;
                                         })),
index afabcdfc27ad874eed3ef820c4006976b067e107..3347a6cd4be72ecf686c5426139595e02cfc17ba 100644 (file)
@@ -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;
                                         })),
index 7b06424b702b24d3e2a6bef0f6cc45d61a7995cf..7920edde48cd19e00e4a2d4c182f6e16d92876cf 100644 (file)
@@ -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));
   }
 
index 09805f78976c61f11452aa0ffdf26cf09eccf106..057159ceb4b884bde21d2d0ca293b28e44df85fd 100644 (file)
@@ -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();
index 42e5a42a6ea8bed11d1e3794d8aaa2dbe508dcb2..0e2d44c4aab91f6b571e52f339e4fa31bda6612c 100644 (file)
@@ -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);
               })),