mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
Merge pull request #47290 from aisakaki/wip-omap-clear
crimson/os/seastore/omap: remove unnecessary extent loads when clearing Reviewed-by: Yingxin Cheng <yingxin.cheng@intel.com> Reviewed-by: Chunmei Liu <chunmei.liu@intel.com>
This commit is contained in:
commit
78a23ebcad
@ -269,16 +269,26 @@ OMapInnerNode::clear(omap_context_t oc)
|
||||
{
|
||||
LOG_PREFIX(OMapInnerNode::clear);
|
||||
DEBUGT("this: {}", oc.t, *this);
|
||||
return trans_intr::do_for_each(iter_begin(), iter_end(), [this, oc] (auto iter) {
|
||||
return trans_intr::do_for_each(iter_begin(), iter_end(),
|
||||
[oc, this](auto iter) {
|
||||
auto laddr = iter->get_val();
|
||||
return omap_load_extent(oc, laddr, get_meta().depth - 1).si_then(
|
||||
[oc] (auto &&extent) {
|
||||
return extent->clear(oc);
|
||||
}).si_then([oc, laddr] {
|
||||
return dec_ref(oc, laddr);
|
||||
}).si_then([ref = OMapNodeRef(this)] {
|
||||
return clear_iertr::now();
|
||||
});
|
||||
auto ndepth = get_meta().depth - 1;
|
||||
if (ndepth > 1) {
|
||||
return omap_load_extent(oc, laddr, ndepth
|
||||
).si_then([oc](auto &&extent) {
|
||||
return extent->clear(oc);
|
||||
}).si_then([oc, laddr] {
|
||||
return dec_ref(oc, laddr);
|
||||
}).si_then([ref = OMapNodeRef(this)] {
|
||||
return clear_iertr::now();
|
||||
});
|
||||
} else {
|
||||
assert(ndepth == 1);
|
||||
return dec_ref(oc, laddr
|
||||
).si_then([ref = OMapNodeRef(this)] {
|
||||
return clear_iertr::now();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user