From: Matan Breizman Date: Tue, 29 Jul 2025 12:16:56 +0000 (+0000) Subject: crimson/os/seastore: SeaStore::umount() into coroutines X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7852c28481f0ba3e61c1936fca70e8aa1883d693;p=ceph.git crimson/os/seastore: SeaStore::umount() into coroutines Switch to errorator to not handle each error. Let the caller handle error instead. Signed-off-by: Matan Breizman --- diff --git a/src/crimson/os/seastore/seastore.cc b/src/crimson/os/seastore/seastore.cc index a00aed02e3b5..33ceb124c05a 100644 --- a/src/crimson/os/seastore/seastore.cc +++ b/src/crimson/os/seastore/seastore.cc @@ -315,40 +315,27 @@ seastar::future<> SeaStore::umount() INFO("..."); ceph_assert(seastar::this_shard_id() == primary_core); - return shard_stores.invoke_on_all([](auto &local_store) { - return local_store.umount(); - }).then([FNAME] { - INFO("done"); + co_await shard_stores.invoke_on_all([](auto &local_store) { + return local_store.umount().handle_error( + crimson::ct_error::assert_all{"Invalid error in SeaStoreS::umount"} + ); }); + INFO("done"); } -seastar::future<> SeaStore::Shard::umount() +base_ertr::future<> SeaStore::Shard::umount() { - return [this] { - if (transaction_manager) { - return transaction_manager->close(); - } else { - return TransactionManager::close_ertr::now(); - } - }().safe_then([this] { - return crimson::do_for_each( - secondaries, - [](auto& sec_dev) -> SegmentManager::close_ertr::future<> - { - return sec_dev->close(); - }); - }).safe_then([this] { - return device->close(); - }).safe_then([this] { - secondaries.clear(); - transaction_manager.reset(); - collection_manager.reset(); - onode_manager.reset(); - }).handle_error( - crimson::ct_error::assert_all{ - "Invalid error in SeaStoreS::umount" - } - ); + if (transaction_manager) { + co_await transaction_manager->close(); + } + for (auto& sec_dev : secondaries) { + co_await sec_dev->close(); + } + co_await device->close(); + secondaries.clear(); + transaction_manager.reset(); + collection_manager.reset(); + onode_manager.reset(); } seastar::future<> SeaStore::write_fsid(uuid_d new_osd_fsid) diff --git a/src/crimson/os/seastore/seastore.h b/src/crimson/os/seastore/seastore.h index 126958250d56..005a7dd21dc7 100644 --- a/src/crimson/os/seastore/seastore.h +++ b/src/crimson/os/seastore/seastore.h @@ -186,7 +186,7 @@ public: // only exposed to SeaStore public: - seastar::future<> umount(); + base_ertr::future<> umount(); // init managers and mount transaction_manager seastar::future<> mount_managers();