]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: avoid unneeded obc catching in PG::do_osd_ops_execute().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 22 Mar 2021 17:18:20 +0000 (17:18 +0000)
committerKefu Chai <kchai@redhat.com>
Mon, 19 Apr 2021 07:58:19 +0000 (15:58 +0800)
Actually, `OpsExecuter` already holds `ObjectContextRef` and even
has a (private till now) getter for `hobject_t` extraction.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/ops_executer.h
src/crimson/osd/pg.cc

index e77f32e3f7158ea587c036d3c8d8d781ff9aa46f..cc9abf4385678ffc400913f72172ac72e1552ccc 100644 (file)
@@ -166,10 +166,6 @@ private:
     class OSDOp& osd_op,
     const class ObjectState& os);
 
-  const hobject_t &get_target() const {
-    return obc->obs.oi.soid;
-  }
-
   template <class Func>
   auto do_const_op(Func&& f) {
     // TODO: pass backend as read-only
@@ -216,6 +212,10 @@ public:
   template <typename MutFunc>
   osd_op_ierrorator::future<> flush_changes(MutFunc&& mut_func) &&;
 
+  const hobject_t &get_target() const {
+    return obc->obs.oi.soid;
+  }
+
   const auto& get_message() const {
     return msg;
   }
index 224ae283e2c4cfa66b2bf056a13c9468b0a21875..565024caacf78140b743b353e9847dfb84b1c1c4 100644 (file)
@@ -715,18 +715,18 @@ PG::do_osd_ops(
   auto ox = std::make_unique<OpsExecuter>(
     obc, op_info, get_pool().info, get_backend(), *m);
   return interruptor::do_for_each(
-    m->ops.begin(), m->ops.end(), [obc, m, ox = ox.get()](OSDOp& osd_op) {
+    m->ops.begin(), m->ops.end(), [m, ox = ox.get()](OSDOp& osd_op) {
     logger().debug(
       "do_osd_ops: {} - object {} - handling op {}",
       *m,
-      obc->obs.oi.soid,
+      ox->get_target(),
       ceph_osd_op_name(osd_op.op.op));
     return ox->execute_op(osd_op);
-  }).safe_then_interruptible([this, obc, m, ox = ox.get(), &op_info] {
+  }).safe_then_interruptible([this, m, ox = ox.get(), &op_info] {
     logger().debug(
       "do_osd_ops: {} - object {} all operations successful",
       *m,
-      obc->obs.oi.soid);
+      ox->get_target());
     return std::move(*ox).flush_changes(
       [this, m, &op_info] (auto&& txn,
                           auto&& obc,
@@ -735,7 +735,7 @@ PG::do_osd_ops(
        logger().debug(
          "do_osd_ops: {} - object {} submitting txn",
          *m,
-         obc->obs.oi.soid);
+         obc->get_oid());
         fill_op_params_bump_pg_version(osd_op_p, std::move(m), user_modify);
        return submit_transaction(
           op_info,