]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/.../replicated_request: convert with_pg_interruptible to coroutine
authorSamuel Just <sjust@redhat.com>
Fri, 13 Dec 2024 21:43:15 +0000 (21:43 +0000)
committerSamuel Just <sjust@redhat.com>
Tue, 17 Dec 2024 17:14:28 +0000 (09:14 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/osd_operations/replicated_request.cc

index c8b2bdd381695478b9e2010f41bc7fa72956963e..4768b83e27c249e6613fd29ce379e015b312c16f 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "common/Formatter.h"
 
+#include "crimson/common/coroutine.h"
 #include "crimson/osd/osd.h"
 #include "crimson/osd/osd_connection_priv.h"
 #include "crimson/osd/osd_operation_external_tracking.h"
@@ -68,17 +69,14 @@ RepRequest::interruptible_future<> RepRequest::with_pg_interruptible(
 {
   LOG_PREFIX(RepRequest::with_pg_interruptible);
   DEBUGI("{}", *this);
-  return this->template enter_stage<interruptor>(repop_pipeline(*pg).process
-  ).then_interruptible([this, pg] {
-    return this->template with_blocking_event<
-      PG_OSDMapGate::OSDMapBlocker::BlockingEvent
-      >([this, pg](auto &&trigger) {
-        return pg->osdmap_gate.wait_for_map(
-          std::move(trigger), req->min_epoch);
-      });
-  }).then_interruptible([this, pg] (auto) {
-    return pg->handle_rep_op(req);
-  });
+  co_await this->template enter_stage<interruptor>(repop_pipeline(*pg).process);
+  co_await interruptor::make_interruptible(this->template with_blocking_event<
+    PG_OSDMapGate::OSDMapBlocker::BlockingEvent
+    >([this, pg](auto &&trigger) {
+      return pg->osdmap_gate.wait_for_map(
+       std::move(trigger), req->min_epoch);
+    }));
+  co_await pg->handle_rep_op(req);
 }
 
 seastar::future<> RepRequest::with_pg(