From f53fceca85998fb690538e54243db2905b75512e Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 2 Aug 2019 14:43:02 -0400 Subject: [PATCH] maple_tree: Fix coalesce to skip duplicate pivots and to run on leaves Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d32b23ec6dc0..59a3846e369c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2299,9 +2299,6 @@ static inline int mas_coalesce(struct ma_state *mas, unsigned char s_slot) unsigned char pivot_cnt; //bool check_prev = false; - if (ma_is_leaf(type)) - return 0; - slot_cnt = mt_slots[type]; pivot_cnt = mt_pivots[type]; @@ -2309,13 +2306,6 @@ static inline int mas_coalesce(struct ma_state *mas, unsigned char s_slot) if (s_slot < pivot_cnt) { unsigned long pivot = ma_get_pivot(src, s_slot); - if (!s_slot) { - last = pivot; - if (mas->min == pivot) - printk("Should check coalescing of previous node\n"); - continue; - } - if (!pivot) goto done; @@ -2330,6 +2320,7 @@ static inline int mas_coalesce(struct ma_state *mas, unsigned char s_slot) goto mas_error; dst = mas->node; + continue; } last = pivot; -- 2.50.1