]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wip: maple_tree: factor out descend and node adoption
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 25 Jun 2020 01:41:15 +0000 (21:41 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:05:02 +0000 (15:05 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index f2e6a1c2b31fa956fb237ca9c164b696a8d632f5..a24af99f13e828fd93d6c22cad674082e5ea5cb0 100644 (file)
@@ -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);