From: Liam R. Howlett Date: Wed, 23 Sep 2020 02:42:26 +0000 (-0400) Subject: maple_tree: mas_parent_gap no longer updates limits X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e5c9f42828301c33678cd396360e8adb1e5fc92d;p=users%2Fjedix%2Flinux-maple.git maple_tree: mas_parent_gap no longer updates limits Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1d89ea6f0c29..feb164fc770b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1142,16 +1142,17 @@ static inline void mas_parent_gap(struct ma_state *mas, unsigned char slot, ascend: /* Go to the parent node. */ - mas_ascend(&gaps); + gaps.node = mt_mk_node(mte_parent(gaps.node), + mas_parent_enum(&gaps, gaps.node)); old_max_gap = mas_max_gap(&gaps); mte_set_gap(gaps.node, slot, new); - new = mas_max_gap(&gaps); + if (mte_is_root(gaps.node)) + return; + new = mas_max_gap(&gaps); if (new == old_max_gap) return; - if (mte_is_root(gaps.node)) - return; slot = mte_parent_slot(gaps.node); goto ascend;