]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: do not pass ops to submit_transaction() separately
authorKefu Chai <kchai@redhat.com>
Sun, 7 Feb 2021 15:12:14 +0000 (23:12 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 9 Feb 2021 03:38:22 +0000 (11:38 +0800)
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 <kchai@redhat.com>
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 4aeec8dd6ac5195d1a80d4cee1793438f2196c6b..f0e92bf58e58cf22a4e805fca5c94802cccdac48 100644 (file)
@@ -567,7 +567,6 @@ seastar::future<> PG::WaitForActiveBlocker::stop()
 }
 
 seastar::future<> PG::submit_transaction(const OpInfo& op_info,
-                                        const std::vector<OSDOp>& 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<pg_log_entry_t> 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));
index 4c9e74d9fcb86547e314dfcea1d71d108bc5bf31..15a6dc8bf505c93fc1f49dc99d69c9108d9314c8 100644 (file)
@@ -535,7 +535,6 @@ private:
     const OpInfo &op_info);
   seastar::future<Ref<MOSDOpReply>> do_pg_ops(Ref<MOSDOp> m);
   seastar::future<> submit_transaction(const OpInfo& op_info,
-                                      const std::vector<OSDOp>& ops,
                                       ObjectContextRef&& obc,
                                       ceph::os::Transaction&& txn,
                                       const osd_op_params_t& oop);