]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Use ma_slots() instead of mas_get_slot() in _mas_awalk()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 29 Sep 2020 13:35:25 +0000 (09:35 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:30:31 +0000 (12:30 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 0ed7192ae54a0fee161a8a6b598eb9490aefedea..f31c7399dd25e52e9bbfb61f946c6658a468e2ed 100644 (file)
@@ -3636,6 +3636,7 @@ static inline bool _mas_awalk(struct ma_state *mas, unsigned long size)
        unsigned long pivot, min, gap = 0;
        unsigned char offset = 0, pivot_cnt = mt_pivots[type];
        unsigned long *gaps = NULL, *pivots = ma_pivots(mas_mn(mas), type);
+       void **slots = ma_slots(mas_mn(mas), type);
        bool found = false;
 
        if (ma_is_dense(type)) {
@@ -3660,9 +3661,8 @@ static inline bool _mas_awalk(struct ma_state *mas, unsigned long size)
 
                if (gaps)
                        gap = gaps[offset];
-               else if (!mas_get_slot(mas, offset))
-                       gap = min(pivot, mas->last) -
-                               max(mas->index, min) + 1;
+               else if (!mas_slot(mas, slots, offset))
+                       gap = min(pivot, mas->last) - max(mas->index, min) + 1;
                else
                        goto next_slot;
 
@@ -3672,7 +3672,7 @@ static inline bool _mas_awalk(struct ma_state *mas, unsigned long size)
                                goto done;
                        }
                        if (mas->index <= pivot) {
-                               mas->node = mas_get_slot(mas, offset);
+                               mas->node = mas_slot(mas, slots, offset);
                                mas->min = min;
                                mas->max = pivot;
                                offset = 0;