From 2d0c00f8c104403b9cca6c2ba25c3eef6c9591a9 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Mon, 30 Aug 2021 15:24:58 +0800 Subject: [PATCH] crimson/os/seastore/lba_manager: cleanup LBABtree::iterate_repeat() Signed-off-by: Yingxin Cheng --- .../lba_manager/btree/btree_lba_manager.cc | 16 ++++++++-------- .../os/seastore/lba_manager/btree/lba_btree.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc index 361b0bb4053..6f3be5e1909 100644 --- a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc +++ b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc @@ -51,13 +51,13 @@ BtreeLBAManager::get_mappings( btree.upper_bound_right(c, offset), [&ret, offset, length](auto &pos) { if (pos.is_end() || pos.get_key() >= (offset + length)) { - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::yes); } ceph_assert((pos.get_key() + pos.get_val().len) > offset); ret.push_back(pos.get_pin()); - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::no); }); @@ -145,12 +145,12 @@ BtreeLBAManager::alloc_extent( [&state, len](auto &pos) { if (pos.is_end() || pos.get_key() >= (state.last_end + len)) { state.insert_iter = pos; - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::yes); } else { state.last_end = pos.get_key() + pos.get_val().len; - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::no); } @@ -284,13 +284,13 @@ BtreeLBAManager::scan_mappings_ret BtreeLBAManager::scan_mappings( btree.upper_bound_right(c, begin), [f=std::move(f), begin, end](auto &pos) { if (pos.is_end() || pos.get_key() >= end) { - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::yes); } ceph_assert((pos.get_key() + pos.get_val().len) > begin); f(pos.get_key(), pos.get_val().paddr, pos.get_val().len); - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::no); }); @@ -315,12 +315,12 @@ BtreeLBAManager::scan_mapped_space_ret BtreeLBAManager::scan_mapped_space( btree.lower_bound(c, 0, &visitor), [&visitor](auto &pos) { if (pos.is_end()) { - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::yes); } visitor(pos.get_val().paddr, pos.get_val().len); - return LBABtree::iterate_repeat_ret( + return LBABtree::iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::no); }, diff --git a/src/crimson/os/seastore/lba_manager/btree/lba_btree.h b/src/crimson/os/seastore/lba_manager/btree/lba_btree.h index 3f22467e64d..1052d88a208 100644 --- a/src/crimson/os/seastore/lba_manager/btree/lba_btree.h +++ b/src/crimson/os/seastore/lba_manager/btree/lba_btree.h @@ -244,10 +244,10 @@ public: return upper_bound(c, L_ADDR_MAX); } - using iterate_repeat_ret = base_iertr::future< + using iterate_repeat_ret_inner = base_iertr::future< seastar::stop_iteration>; template - static auto iterate_repeat( + static base_iertr::future<> iterate_repeat( op_context_t c, iterator_fut &&iter_fut, F &&f, @@ -265,7 +265,7 @@ public: pos ).si_then([c, visitor, &pos](auto done) { if (done == seastar::stop_iteration::yes) { - return iterate_repeat_ret( + return iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::yes); } else { @@ -274,7 +274,7 @@ public: c, visitor ).si_then([&pos](auto next) { pos = next; - return iterate_repeat_ret( + return iterate_repeat_ret_inner( interruptible::ready_future_marker{}, seastar::stop_iteration::no); });