[PATCH 7/7] maple_tree: only ascend left subtree to get the old node for replacement
Wei Yang
richard.weiyang at gmail.com
Tue Nov 26 17:27:53 PST 2024
When we come to a new_root, we should go up the tree to get the old root
for replacement.
Instead of ascend both left/right subtree, we only ascend one of it is
enough. Let's use the left subtree as it dose now.
Signed-off-by: Wei Yang <richard.weiyang at gmail.com>
CC: Liam R. Howlett <Liam.Howlett at Oracle.com>
CC: Sidhartha Kumar <sidhartha.kumar at oracle.com>
CC: Lorenzo Stoakes <lorenzo.stoakes at oracle.com>
---
lib/maple_tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 4ba9ae68c0a9..2c05919be168 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -2920,7 +2920,7 @@ static void mas_spanning_rebalance(struct ma_state *mas,
new_root:
mas_mn(mast->l)->parent = ma_parent_ptr(mas_tree_parent(mas));
while (!mte_is_root(mast->orig_l->node))
- mast_ascend(mast);
+ mas_ascend(mast->orig_l);
} else {
mas_mn(&l_mas)->parent = mas_mn(mast->orig_l)->parent;
}
--
2.34.1
More information about the maple-tree
mailing list