]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
cleanup mast_new_root
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 17 Jul 2020 19:59:10 +0000 (15:59 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:05:24 +0000 (15:05 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index fe22391fb1b83e198774ad845f6ed0c905ad8851..d629ef53372850f13df4733fb8c207bdca53b676 100644 (file)
@@ -2004,17 +2004,14 @@ static inline bool mast_new_root(struct maple_subtree_state *mast,
        mas_mn(mast->l)->parent =
                ma_parent_ptr(((unsigned long)mas->tree | MA_ROOT_PARENT));
        mas->depth = mast->orig_l->depth;
-       mast->bn->b_end = 0;
-       if (mte_is_root(mast->orig_l->node)) {
-               if ((mast->orig_l->node != mas->node) &&
-                   (mast->l->depth > mas->tree->ma_height)) {
-                       mat_add(mast->free, mas->node);
-               }
-       } else {
+       if (!mte_is_root(mast->orig_l->node)) {
                do {
                        mast_ascend_free(mast);
                        mast_topiary(mast);
                } while (!mte_is_root(mast->orig_l->node));
+       } else if ((mast->orig_l->node != mas->node) &&
+                  (mast->l->depth > mas->tree->ma_height)) {
+                       mat_add(mast->free, mas->node);
        }
 
        mat_add(mast->free, mast->orig_l->node);