From 2563a0bd43cb09365d0d80786c2192856c0e7c3f Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 8 Feb 2019 08:31:29 +0000 Subject: [PATCH] librados_test_stub: add cls_cxx_replace Signed-off-by: Mykola Golub --- src/test/librados_test_stub/LibradosTestStub.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 78a290a3ac5e9..f3cb4f864bc5a 100644 --- a/src/test/librados_test_stub/LibradosTestStub.cc +++ b/src/test/librados_test_stub/LibradosTestStub.cc @@ -1366,6 +1366,17 @@ int cls_cxx_write_full(cls_method_context_t hctx, bufferlist *inbl) { return ctx->io_ctx_impl->write_full(ctx->oid, *inbl, ctx->snapc); } +int cls_cxx_replace(cls_method_context_t hctx, int ofs, int len, + bufferlist *inbl) { + librados::TestClassHandler::MethodContext *ctx = + reinterpret_cast(hctx); + int r = ctx->io_ctx_impl->truncate(ctx->oid, 0, ctx->snapc); + if (r < 0) { + return r; + } + return ctx->io_ctx_impl->write(ctx->oid, *inbl, len, ofs, ctx->snapc); +} + int cls_cxx_list_watchers(cls_method_context_t hctx, obj_list_watch_response_t *watchers) { librados::TestClassHandler::MethodContext *ctx = -- 2.39.5