From: Liam R. Howlett Date: Fri, 2 Aug 2019 18:43:02 +0000 (-0400) Subject: maple_tree: Fix coalesce to skip duplicate pivots and to run on leaves X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f53fceca85998fb690538e54243db2905b75512e;p=users%2Fjedix%2Flinux-maple.git maple_tree: Fix coalesce to skip duplicate pivots and to run on leaves Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d32b23ec6dc04..59a3846e369c6 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;