]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/.../scrub_events: convert ScrubFindRange::run to a coroutine
authorSamuel Just <sjust@redhat.com>
Wed, 27 Mar 2024 01:39:17 +0000 (01:39 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 15 May 2024 15:01:06 +0000 (18:01 +0300)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 5b0416ae100443f43361e1308e2d28e2763ba725)

src/crimson/osd/osd_operations/scrub_events.cc

index dbe22a086bb49a8b24f791019d850a6a13f2c926..feffce8c05f0f407ae469e6c9b14c9bf554ef332 100644 (file)
@@ -88,24 +88,21 @@ ScrubFindRange::ifut<> ScrubFindRange::run(PG &pg)
 {
   LOG_PREFIX(ScrubFindRange::run);
   using crimson::common::local_conf;
-  return interruptor::make_interruptible(
+  auto [_, next] = co_await interruptor::make_interruptible(
     pg.shard_services.get_store().list_objects(
       pg.get_collection_ref(),
       ghobject_t(begin, ghobject_t::NO_GEN, pg.get_pgid().shard),
       ghobject_t::get_max(),
       local_conf().get_val<int64_t>("osd_scrub_chunk_max")
-    )
-  ).then_interruptible([FNAME, this, &pg](auto ret) {
-    auto &[_, next] = ret;
+    ));
 
-    // We rely on seeing an entire set of snapshots in a single chunk
-    auto end = next.hobj.get_max_object_boundary();
+  // We rely on seeing an entire set of snapshots in a single chunk
+  auto end = next.hobj.get_max_object_boundary();
 
-    DEBUGDPP("got next.hobj: {}, returning begin, end: {}, {}",
-            pg, next.hobj, begin, end);
-    pg.scrubber.machine.process_event(
-      scrub::ScrubContext::request_range_complete_t{begin, end});
-  });
+  DEBUGDPP("got next.hobj: {}, returning begin, end: {}, {}",
+          pg, next.hobj, begin, end);
+  pg.scrubber.machine.process_event(
+    scrub::ScrubContext::request_range_complete_t{begin, end});
 }
 
 template class ScrubAsyncOpT<ScrubFindRange>;