From: Samuel Just Date: Wed, 17 Sep 2025 21:35:08 +0000 (+0000) Subject: crimson/.../transaction_manager: convert read_extent to coroutine X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2cba7195281cd187c5247186c9ab354dbd349035;p=ceph-ci.git crimson/.../transaction_manager: convert read_extent to coroutine Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/seastore/transaction_manager.h b/src/crimson/os/seastore/transaction_manager.h index 73d4efd2a68..d7b205c8f6a 100644 --- a/src/crimson/os/seastore/transaction_manager.h +++ b/src/crimson/os/seastore/transaction_manager.h @@ -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 { - 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, 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, 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 { - 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, 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, std::move(pin), std::move(maybe_init)); } template