]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/osd_operations/snaptrim_event: make use of process_and_submit
authorMatan Breizman <mbreizma@redhat.com>
Mon, 26 Aug 2024 10:18:08 +0000 (10:18 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 9 Sep 2024 09:38:08 +0000 (09:38 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/osd_operations/snaptrim_event.cc

index bb497cc1d3aeebe5d0b3bdff3e1397dcf1ace378..15b3a84bf7f36bf165062b7f5d3ff7801a5158c7 100644 (file)
@@ -402,30 +402,8 @@ SnapTrimObjSubEvent::start()
   // lock both clone's and head's obcs
   co_await pg->obc_loader.with_obc<RWState::RWWRITE>(
     coid,
-    [this](auto head_obc, auto clone_obc) -> ObjectContextLoader::load_obc_iertr::future<> {
-      logger().debug("{}: got clone_obc={}", *this, clone_obc->get_oid());
-
-      co_await enter_stage<interruptor>(client_pp().process);
-
-      logger().debug("{}: processing clone_obc={}", *this, clone_obc->get_oid());
-
-      auto txn = co_await remove_or_update(clone_obc, head_obc);
-
-      auto [submitted, all_completed] = co_await pg->submit_transaction(
-             std::move(clone_obc),
-             std::move(txn),
-             std::move(osd_op_p),
-             std::move(log_entries)
-      );
-
-      co_await std::move(submitted);
-
-      co_await enter_stage<interruptor>(client_pp().wait_repop);
-
-      co_await std::move(all_completed);
-
-      co_return;
-    },
+    std::bind(&SnapTrimObjSubEvent::process_and_submit,
+              this, std::placeholders::_1, std::placeholders::_2),
     false
   ).handle_error_interruptible(
     remove_or_update_iertr::pass_further{},