]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/.../transaction_manager: convert read_extent to coroutine
authorSamuel Just <sjust@redhat.com>
Wed, 17 Sep 2025 21:35:08 +0000 (21:35 +0000)
committerSamuel Just <sjust@redhat.com>
Mon, 5 Jan 2026 20:44:34 +0000 (12:44 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/transaction_manager.h

index 73d4efd2a687995e53d4ea4fc59e78e5d433390f..d7b205c8f6aef0fc24d2e5f2f549175bebc036dc 100644 (file)
@@ -234,18 +234,14 @@ public:
     LOG_PREFIX(TransactionManager::read_extent);
     SUBDEBUGT(seastore_tm, "{}~0x{:x} {} ...",
               t, offset, length, T::TYPE);
-    return get_pin(
-      t, offset
-    ).si_then([this, FNAME, &t, offset, length,
-             maybe_init=std::move(maybe_init)] (auto pin) mutable
-      -> read_extent_ret<T> {
-      if (length != pin.get_length() || !pin.get_val().is_real_location()) {
-        SUBERRORT(seastore_tm, "{}~0x{:x} {} got wrong pin {}",
-                  t, offset, length, T::TYPE, pin);
-        ceph_abort_msg("Impossible");
-      }
-      return this->read_pin<T>(t, std::move(pin), std::move(maybe_init));
-    });
+    auto pin = co_await get_pin(t, offset);
+    if (length != pin.get_length() || !pin.get_val().is_real_location()) {
+      SUBERRORT(seastore_tm, "{}~0x{:x} {} got wrong pin {}",
+               t, offset, length, T::TYPE, pin);
+      ceph_abort_msg("Impossible");
+    }
+    co_return co_await this->read_pin<T>(
+      t, std::move(pin), std::move(maybe_init));
   }
 
   /**
@@ -261,18 +257,14 @@ public:
     LOG_PREFIX(TransactionManager::read_extent);
     SUBDEBUGT(seastore_tm, "{} {} ...",
               t, offset, T::TYPE);
-    return get_pin(
-      t, offset
-    ).si_then([this, FNAME, &t, offset,
-             maybe_init=std::move(maybe_init)] (auto pin) mutable
-      -> read_extent_ret<T> {
-      if (!pin.get_val().is_real_location()) {
-        SUBERRORT(seastore_tm, "{} {} got wrong pin {}",
-                  t, offset, T::TYPE, pin);
-        ceph_abort_msg("Impossible");
-      }
-      return this->read_pin<T>(t, std::move(pin), std::move(maybe_init));
-    });
+    auto pin = co_await get_pin(t, offset);
+    if (!pin.get_val().is_real_location()) {
+      SUBERRORT(seastore_tm, "{} {} got wrong pin {}",
+               t, offset, T::TYPE, pin);
+      ceph_abort_msg("Impossible");
+    }
+    co_return co_await this->read_pin<T>(
+      t, std::move(pin), std::move(maybe_init));
   }
 
   template <typename T>