[PATCH 4/4] maple_tree: now we are sure mas_end wouldn't exceed mt_pivots[mt]
Wei Yang
richard.weiyang at gmail.com
Thu Sep 19 16:48:32 PDT 2024
Now all the cases of mas_mab_cp() is called with mas_end at most equals
mt_pivots[mt]. So we can get piv_end == mas_end.
Signed-off-by: Wei Yang <richard.weiyang at gmail.com>
---
lib/maple_tree.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index bb4183b973d4..ef9aba07adbd 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -1907,11 +1907,11 @@ static inline void mas_mab_cp(struct ma_state *mas, unsigned char mas_start,
void __rcu **slots;
unsigned long *pivots, *gaps;
int i = mas_start, j = mab_start;
- unsigned char piv_end;
node = mas_mn(mas);
mt = mte_node_type(mas->node);
pivots = ma_pivots(node, mt);
+
if (!i) {
b_node->pivot[j] = pivots[i++];
if (unlikely(i > mas_end))
@@ -1919,8 +1919,7 @@ static inline void mas_mab_cp(struct ma_state *mas, unsigned char mas_start,
j++;
}
- piv_end = min(mas_end, mt_pivots[mt]);
- for (; i < piv_end; i++, j++) {
+ for (; i < mas_end; i++, j++) {
b_node->pivot[j] = pivots[i];
if (unlikely(!b_node->pivot[j]))
goto complete;
--
2.34.1
More information about the maple-tree
mailing list