From 3c17ea90104573ac5cafc7409e0743c1c101229b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 7 Feb 2021 23:12:14 +0800 Subject: [PATCH] crimson/osd: do not pass ops to submit_transaction() separately the order of evaluation of function arguments is unspecified with some exceptions. but in this case, the reason why ops is still valid is that the parameter type of `osd_op_p` is `const osd_op_params_t&`. so a copy is passed to it. to enable us to actually move `osd_op_p`, in this change, the osd_op_p.req->ops is used instead. Signed-off-by: Kefu Chai --- src/crimson/osd/pg.cc | 3 +-- src/crimson/osd/pg.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 4aeec8dd6ac51..f0e92bf58e58c 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -567,7 +567,6 @@ seastar::future<> PG::WaitForActiveBlocker::stop() } seastar::future<> PG::submit_transaction(const OpInfo& op_info, - const std::vector& ops, ObjectContextRef&& obc, ceph::os::Transaction&& txn, const osd_op_params_t& osd_op_p) @@ -584,6 +583,7 @@ seastar::future<> PG::submit_transaction(const OpInfo& op_info, } std::vector log_entries; + const auto& ops = osd_op_p.req->ops; log_entries.emplace_back(obc->obs.exists ? pg_log_entry_t::MODIFY : pg_log_entry_t::DELETE, obc->obs.oi.soid, osd_op_p.at_version, obc->obs.oi.version, @@ -738,7 +738,6 @@ PG::do_osd_ops( fill_op_params_bump_pg_version(osd_op_p, std::move(m), user_modify); return submit_transaction( op_info, - osd_op_p.req->ops, std::move(obc), std::move(txn), std::move(osd_op_p)); diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 4c9e74d9fcb86..15a6dc8bf505c 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -535,7 +535,6 @@ private: const OpInfo &op_info); seastar::future> do_pg_ops(Ref m); seastar::future<> submit_transaction(const OpInfo& op_info, - const std::vector& ops, ObjectContextRef&& obc, ceph::os::Transaction&& txn, const osd_op_params_t& oop); -- 2.39.5