[PATCH 3/7] maple_tree: check mid_split only may have
Wei Yang
richard.weiyang at gmail.com
Tue Nov 26 17:27:49 PST 2024
We only may set mid_split in the else clause, let's move the check in
it.
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 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 2a00441130ee..f5606b4d0dba 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -2381,10 +2381,11 @@ static inline unsigned char mas_mab_to_node(struct ma_state *mas,
} else {
split = mab_calc_split(mas, b_node, mid_split);
*right = mas_new_ma_node(mas, b_node);
+
+ if (*mid_split)
+ *middle = mas_new_ma_node(mas, b_node);
}
- if (*mid_split)
- *middle = mas_new_ma_node(mas, b_node);
return split;
--
2.34.1
More information about the maple-tree
mailing list