crimson/os/seastore/lba_manager: cleanup LBABtree::iterate_repeat()

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
Yingxin Cheng 2021-08-30 15:24:58 +08:00
parent 6b8d9e0801
commit 2d0c00f8c1
2 changed files with 12 additions and 12 deletions

View File

@ -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);
},

View File

@ -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 <typename F>
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);
});