From afa63c74f9b733f2782c789b8c769e5e33afe90c Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 24 Jun 2020 21:41:15 -0400 Subject: [PATCH] wip: maple_tree: factor out descend and node adoption Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f2e6a1c2b31f..a24af99f13e8 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); -- 2.50.1