]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: inline SnapTrimObjSubEvent::process_and_submit
authorSamuel Just <sjust@redhat.com>
Wed, 16 Oct 2024 18:36:01 +0000 (11:36 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 11 Dec 2024 02:02:00 +0000 (18:02 -0800)
start() isn't particularly long and splitting it here isn't
all that helpful.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/osd_operations/snaptrim_event.cc
src/crimson/osd/osd_operations/snaptrim_event.h

index 8cab612568217a1c617ce3879fc1851dc1482c4a..7f78457167d03eb77fa1175c7cf0a7b3a64da30a 100644 (file)
@@ -411,34 +411,21 @@ SnapTrimObjSubEvent::start()
     crimson::ct_error::assert_all{"unexpected error in SnapTrimObjSubEvent"}
   );
 
-  co_await process_and_submit(
-    obc_manager.get_head_obc(), obc_manager.get_obc()
-  ).handle_error_interruptible(
-    remove_or_update_iertr::pass_further{},
-    crimson::ct_error::assert_all{"unexpected error in SnapTrimObjSubEvent"}
-  );
-
-  logger().debug("{}: completed", *this);
-  co_await interruptor::make_interruptible(handle.complete());
-}
-
-ObjectContextLoader::load_obc_iertr::future<>
-SnapTrimObjSubEvent::process_and_submit(ObjectContextRef head_obc,
-                                        ObjectContextRef clone_obc) {
-  logger().debug("{}: got clone_obc={}", *this, clone_obc->get_oid());
+  logger().debug("{}: got obc={}", *this, obc_manager.get_obc()->get_oid());
 
   co_await enter_stage<interruptor>(client_pp().process);
 
-  logger().debug("{}: processing clone_obc={}", *this, clone_obc->get_oid());
+  logger().debug("{}: processing obc={}", *this, obc_manager.get_obc()->get_oid());
 
-  auto txn = co_await remove_or_update(clone_obc, head_obc);
+  auto txn = co_await remove_or_update(
+    obc_manager.get_obc(), obc_manager.get_head_obc());
 
   auto [submitted, all_completed] = co_await pg->submit_transaction(
-         std::move(clone_obc),
-         nullptr,
-         std::move(txn),
-         std::move(osd_op_p),
-         std::move(log_entries)
+    ObjectContextRef(obc_manager.get_obc()),
+    nullptr,
+    std::move(txn),
+    std::move(osd_op_p),
+    std::move(log_entries)
   );
 
   co_await std::move(submitted);
@@ -447,7 +434,8 @@ SnapTrimObjSubEvent::process_and_submit(ObjectContextRef head_obc,
 
   co_await std::move(all_completed);
 
-  co_return;
+  logger().debug("{}: completed", *this);
+  co_await interruptor::make_interruptible(handle.complete());
 }
 
 void SnapTrimObjSubEvent::print(std::ostream &lhs) const
index 1164b3169d2934b9386490d592d84f1fc681ff45..fc99138d62f4158c9639592297c5c62c318efcdb 100644 (file)
@@ -112,10 +112,6 @@ public:
 private:
   object_stat_sum_t delta_stats;
 
-  ObjectContextLoader::load_obc_iertr::future<> process_and_submit(
-    ObjectContextRef head_obc,
-    ObjectContextRef clone_obc);
-
   snap_trim_obj_subevent_ret_t remove_clone(
     ObjectContextRef obc,
     ObjectContextRef head_obc,