From: Liam R. Howlett Date: Thu, 25 Jun 2020 01:41:15 +0000 (-0400) Subject: wip: maple_tree: factor out descend and node adoption X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3c495d94ac7224f4528a0168387d9b04b63f91ce;p=users%2Fjedix%2Flinux-maple.git wip: maple_tree: factor out descend and node adoption Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f2e6a1c2b31fa..a24af99f13e82 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2774,17 +2774,7 @@ new_root: if (mte_is_leaf(mas->node)) return 1; - do { - // Ascend. - printk("Ascend from %p\n", mas_mn(&prev_l_mas)); - printk("Ascend from %p\n", mas_mn(&prev_r_mas)); - mas_ascend(&prev_l_mas); - mas_ascend(&prev_r_mas); - // adopt children of nodes that don't have the correct parent - mas_adopt_children(&prev_l_mas, prev_l_mas.node); - mas_adopt_children(&prev_r_mas, prev_r_mas.node); - - } while (prev_l_mas.node != l); + mas_descend_adopt(mas); if (mt_is_alloc(mas->tree)) mas_update_gap(mas, false);