From ca29586120a43f7415e0c00098f67052a0ef8067 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 24 Sep 2019 13:36:07 -0500 Subject: [PATCH] osd/PrimaryLogPG: remove unnecessary claim_op_out_data() calls In all of these cases, the vector* ops in question points to the MOSDOp::ops vector, which is copied by the MOSDOpReply ctor. Move back to a const MOSDOp* where appropropriate. Signed-off-by: Sage Weil --- src/osd/PrimaryLogPG.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 44c6f3a95339e..90dcc08242103 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3790,7 +3790,6 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx) // save just what we need from ctx MOSDOpReply *reply = ctx->reply; ctx->reply = nullptr; - reply->claim_op_out_data(*ctx->ops); reply->get_header().data_off = (ctx->data_off ? *ctx->data_off : 0); close_op_ctx(ctx); @@ -8447,7 +8446,6 @@ void PrimaryLogPG::complete_read_ctx(int result, OpContext *ctx) } ctx->bytes_read += p->outdata.length(); } - ctx->reply->claim_op_out_data(*ctx->ops); ctx->reply->get_header().data_off = (ctx->data_off ? *ctx->data_off : 0); MOSDOpReply *reply = ctx->reply; @@ -8719,10 +8717,7 @@ int PrimaryLogPG::do_copy_get(OpContext *ctx, bufferlist::const_iterator& bp, void PrimaryLogPG::fill_in_copy_get_noent(OpRequestRef& op, hobject_t oid, OSDOp& osd_op) { - // NOTE: we take non-const ref here for claim_op_out_data below; we must - // be careful not to modify anything else that will upset a racing - // operator<< - MOSDOp *m = static_cast(op->get_nonconst_req()); + const MOSDOp *m = static_cast(op->get_req()); uint64_t features = m->get_features(); object_copy_data_t reply_obj; @@ -8732,7 +8727,6 @@ void PrimaryLogPG::fill_in_copy_get_noent(OpRequestRef& op, hobject_t oid, encode(reply_obj, osd_op.outdata, features); osd_op.rval = -ENOENT; MOSDOpReply *reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0, false); - reply->claim_op_out_data(m->ops); reply->set_result(-ENOENT); reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK); osd->send_message_osd_client(reply, m->get_connection()); -- 2.39.5