Merge pull request #18610 from cbodley/wip-osd-subop-num

osd: add processed_subop_count for cls_cxx_subop_version()

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Yuri Weinstein 2017-11-01 08:24:13 -07:00 committed by GitHub
commit 223f45e4e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,5 @@
#!/bin/sh -e
ceph_test_cls_log
exit 0

View File

@ -677,7 +677,7 @@ int cls_current_subop_num(cls_method_context_t hctx)
{
PrimaryLogPG::OpContext *ctx = *(PrimaryLogPG::OpContext **)hctx;
return ctx->current_osd_subop_num;
return ctx->processed_subop_count;
}
uint64_t cls_get_features(cls_method_context_t hctx)

View File

@ -4944,7 +4944,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
dout(10) << "do_osd_op " << soid << " " << ops << dendl;
ctx->current_osd_subop_num = 0;
for (vector<OSDOp>::iterator p = ops.begin(); p != ops.end(); ++p, ctx->current_osd_subop_num++) {
for (auto p = ops.begin(); p != ops.end(); ++p, ctx->current_osd_subop_num++, ctx->processed_subop_count++) {
OSDOp& osd_op = *p;
ceph_osd_op& op = osd_op.op;

View File

@ -536,7 +536,10 @@ public:
eversion_t at_version; // pg's current version pointer
version_t user_at_version; // pg's current user version pointer
/// index of the current subop - only valid inside of do_osd_ops()
int current_osd_subop_num;
/// total number of subops processed in this context for cls_cxx_subop_version()
int processed_subop_count = 0;
PGTransactionUPtr op_t;
vector<pg_log_entry_t> log;

View File

@ -14,4 +14,6 @@ target_link_libraries(ceph_test_cls_log
${CRYPTO_LIBS}
${EXTRALIBS}
)
install(TARGETS
ceph_test_cls_log
DESTINATION ${CMAKE_INSTALL_BINDIR})