]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/.../extent_placement_manager: convert BackgroundProcess::run() to coroutine
authorSamuel Just <sjust@redhat.com>
Mon, 25 Aug 2025 21:34:23 +0000 (14:34 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 17 Sep 2025 16:17:16 +0000 (09:17 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/extent_placement_manager.cc

index be53c9c292c1dbbf788d7fbecbc0316d550e1f21..b454d03a8771c01e1e6a19797ce0adff631ce817 100644 (file)
@@ -741,26 +741,18 @@ seastar::future<>
 ExtentPlacementManager::BackgroundProcess::run()
 {
   assert(is_running());
-  return seastar::repeat([this] {
-    if (!is_running()) {
-      log_state("run(exit)");
-      return seastar::make_ready_future<seastar::stop_iteration>(
-          seastar::stop_iteration::yes);
+  while (is_running()) {
+    if (background_should_run()) {
+      log_state("run(background)");
+      co_await do_background_cycle();
+    } else {
+      log_state("run(block)");
+      assert(!blocking_background);
+      blocking_background = seastar::promise<>();
+      co_await blocking_background->get_future();
     }
-    return seastar::futurize_invoke([this] {
-      if (background_should_run()) {
-        log_state("run(background)");
-        return do_background_cycle();
-      } else {
-        log_state("run(block)");
-        ceph_assert(!blocking_background);
-        blocking_background = seastar::promise<>();
-        return blocking_background->get_future();
-      }
-    }).then([] {
-      return seastar::stop_iteration::no;
-    });
-  });
+  }
+  log_state("run(exit)");
 }
 
 /**