From: Mykola Golub Date: Fri, 8 Feb 2019 08:31:29 +0000 (+0000) Subject: librados_test_stub: add cls_cxx_replace X-Git-Tag: v14.1.0~77^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2563a0bd43cb09365d0d80786c2192856c0e7c3f;p=ceph-ci.git librados_test_stub: add cls_cxx_replace Signed-off-by: Mykola Golub --- diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 78a290a3ac5..f3cb4f864bc 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 =