]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: factor out InternalClientRequest::do_process
authorSamuel Just <sjust@redhat.com>
Thu, 26 Sep 2024 22:30:59 +0000 (22:30 +0000)
committerSamuel Just <sjust@redhat.com>
Tue, 15 Oct 2024 03:37:26 +0000 (20:37 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/osd_operations/internal_client_request.cc
src/crimson/osd/osd_operations/internal_client_request.h

index dabff1a33bdb684d613b06690c77a5e6a5f40a6b..d0ee392ecb6386ded06e8a632cdd691d2396d1b4 100644 (file)
@@ -50,6 +50,30 @@ CommonPGPipeline& InternalClientRequest::client_pp()
   return pg->request_pg_pipeline;
 }
 
+InternalClientRequest::interruptible_future<>
+InternalClientRequest::do_process(
+  crimson::osd::ObjectContextRef obc,
+  std::vector<OSDOp> &osd_ops)
+{
+  return pg->do_osd_ops(
+    std::move(obc),
+    osd_ops,
+    std::as_const(op_info),
+    get_do_osd_ops_params()
+  ).safe_then_unpack_interruptible(
+    [](auto submitted, auto all_completed) {
+      return all_completed.handle_error_interruptible(
+       crimson::ct_error::eagain::handle([] {
+         ceph_assert(0 == "not handled");
+         return seastar::now();
+       }));
+    }, crimson::ct_error::eagain::handle([] {
+      ceph_assert(0 == "not handled");
+      return interruptor::now();
+    })
+  );
+}
+
 InternalClientRequest::interruptible_future<>
 InternalClientRequest::with_interruption()
 {
@@ -93,24 +117,8 @@ InternalClientRequest::with_interruption()
     [&osd_ops, this](auto, auto obc) {
       return enter_stage<interruptor>(client_pp().process
       ).then_interruptible(
-       [obc=std::move(obc), &osd_ops, this] {
-         return pg->do_osd_ops(
-           std::move(obc),
-           osd_ops,
-           std::as_const(op_info),
-           get_do_osd_ops_params()
-         ).safe_then_unpack_interruptible(
-           [](auto submitted, auto all_completed) {
-             return all_completed.handle_error_interruptible(
-               crimson::ct_error::eagain::handle([] {
-                 ceph_assert(0 == "not handled");
-                 return seastar::now();
-               }));
-           }, crimson::ct_error::eagain::handle([] {
-             ceph_assert(0 == "not handled");
-             return interruptor::now();
-           })
-         );
+       [obc=std::move(obc), &osd_ops, this]() mutable {
+         return do_process(std::move(obc), osd_ops);
        });
     }).handle_error_interruptible(
       crimson::ct_error::assert_all("unexpected error")
index 782fb809042a61b8974ec4df09ccba2eb477fdcd..6023db0a8dbe2f727edbfa8fa9bf283d91295dc2 100644 (file)
@@ -41,6 +41,9 @@ private:
   CommonPGPipeline& client_pp();
 
   InternalClientRequest::interruptible_future<> with_interruption();
+  InternalClientRequest::interruptible_future<> do_process(
+    crimson::osd::ObjectContextRef obc,
+    std::vector<OSDOp> &osd_ops);
 
   seastar::future<> do_process();