]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: PG::do_osd_ops_execute() doesn't directly takes ObjectContextRef.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 23 Mar 2021 21:21:02 +0000 (21:21 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 10 May 2021 16:01:32 +0000 (18:01 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/ops_executer.h
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index a2927519ff83c50adbf49f66292600b41416bef6..6bac348a0578b1827ebbb0944471b6913f5a9636 100644 (file)
@@ -241,6 +241,9 @@ public:
   template <class Func>
   struct RollbackHelper {
     interruptible_future<> rollback_obc_if_modified(const std::error_code& e);
+    ObjectContextRef get_obc() const {
+      return ox.obc;
+    }
     OpsExecuter& ox;
     Func func;
   };
index d7c4f87a659f6f63cce905f26ed1c871b6d4c8ff..fc60f77384eda10860ae24ef0ba52a7e1adedb4f 100644 (file)
@@ -702,7 +702,6 @@ PG::do_osd_ops_iertr::future<Ret> PG::do_osd_ops_execute(
   OpsExecuter&& ox,
   std::vector<OSDOp> ops,
   Ref<MOSDOp> m,
-  ObjectContextRef obc,
   const OpInfo &op_info,
   SuccessFunc&& success_func,
   FailureFunc&& failure_func)
@@ -743,12 +742,12 @@ PG::do_osd_ops_iertr::future<Ret> PG::do_osd_ops_execute(
   }).safe_then_interruptible_tuple([success_func=std::move(success_func)] {
     return std::move(success_func)();
   }, crimson::ct_error::object_corrupted::handle(
-    [obc, rollbacker, this] (const std::error_code& e) mutable {
+    [rollbacker, this] (const std::error_code& e) mutable {
     // this is a path for EIO. it's special because we want to fix the obejct
     // and try again. that is, the layer above `PG::do_osd_ops` is supposed to
     // restart the execution.
     return rollbacker.rollback_obc_if_modified(e).then_interruptible(
-      [obc, this] {
+      [obc=rollbacker.get_obc(), this] {
       return repair_object(obc->obs.oi.soid,
                            obc->obs.oi.version).then_interruptible([] {
         return do_osd_ops_iertr::future<Ret>{crimson::ct_error::eagain::make()};
@@ -774,10 +773,10 @@ PG::do_osd_ops(
     throw crimson::common::system_shutdown_exception();
   }
   auto ox = std::make_unique<OpsExecuter>(
-    obc, op_info, get_pool().info, get_backend(), *m);
+    std::move(obc), op_info, get_pool().info, get_backend(), *m);
   return do_osd_ops_execute<Ref<MOSDOpReply>>(
-    std::move(*ox), m->ops, m, obc, op_info,
-    [this, m, obc, rvec = op_info.allows_returnvec()] {
+    std::move(*ox), m->ops, m, op_info,
+    [this, m, rvec = op_info.allows_returnvec()] {
       // TODO: should stop at the first op which returns a negative retval,
       //       cmpext uses it for returning the index of first unmatched byte
       int result = m->ops.empty() ? 0 : m->ops.back().rval.code;
@@ -793,7 +792,7 @@ PG::do_osd_ops(
       logger().debug(
         "do_osd_ops: {} - object {} sending reply",
         *m,
-        obc->obs.oi.soid);
+        m->get_hobj());
       return do_osd_ops_iertr::make_ready_future<Ref<MOSDOpReply>>(
         std::move(reply));
     },
index 0e1d7fe1329cdad0f92ca385cafe20bf593cc953..ba477ee440408edcabec026e7d8b4e5d6bbc4a4d 100644 (file)
@@ -583,7 +583,6 @@ private:
     OpsExecuter&& ox,
     std::vector<OSDOp> ops,
     Ref<MOSDOp> m,
-    ObjectContextRef obc,
     const OpInfo &op_info,
     SuccessFunc&& success_func,
     FailureFunc&& failure_func);