From: Liam R. Howlett Date: Fri, 17 Jul 2020 19:59:10 +0000 (-0400) Subject: cleanup mast_new_root X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=68852c550950bd0e128d931d0bbb8519f490d24f;p=users%2Fjedix%2Flinux-maple.git cleanup mast_new_root Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fe22391fb1b8..d629ef533728 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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);