]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Use get_slots for extend_null
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 8 Sep 2020 17:51:19 +0000 (13:51 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:11:26 +0000 (15:11 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 18e38eae0085e3056e2eb2fee7c63c808f2f0942..578772401d3388db9464b4a621ffb26c8527f1ae 100644 (file)
@@ -2868,9 +2868,11 @@ static inline unsigned char mas_extend_null(struct ma_state *l_mas,
        unsigned char l_slot = mas_offset(l_mas);
        unsigned char r_slot = mas_offset(r_mas);
        unsigned char cp_r_slot = r_slot;
-       void *content = mas_get_slot(l_mas, l_slot);
        unsigned long range_max = mas_safe_pivot(r_mas, r_slot);
        unsigned long range_min = l_mas->min;
+       void **slots = ma_get_slots(mte_to_node(l_mas->node),
+                                   mte_node_type(l_mas->node));
+       void *content = slots[l_slot];
 
        if (l_slot)
                range_min = mas_safe_pivot(l_mas, l_slot - 1) + 1;
@@ -2879,7 +2881,7 @@ static inline unsigned char mas_extend_null(struct ma_state *l_mas,
                l_mas->index = range_min;
 
        if ((l_mas->index == range_min) &&
-           l_slot && !mas_get_slot(l_mas, l_slot - 1)) {
+           l_slot && !slots[l_slot - 1]) {
                if (l_slot > 1)
                        l_mas->index = mas_safe_pivot(l_mas, l_slot - 2) + 1;
                else
@@ -2887,14 +2889,16 @@ static inline unsigned char mas_extend_null(struct ma_state *l_mas,
                mas_set_offset(l_mas, l_slot - 1);
        }
 
-       if (!mas_get_slot(r_mas, r_slot)) {
+       slots = ma_get_slots(mte_to_node(r_mas->node),
+                            mte_node_type(r_mas->node));
+       if (!slots[r_slot]) {
                if (r_mas->last < range_max)
                        r_mas->last = range_max;
                cp_r_slot++;
        }
 
        if (r_mas->last == range_max &&
-           r_mas->last < r_mas->max && !mas_get_slot(r_mas, r_slot + 1)) {
+           r_mas->last < r_mas->max && !slots[r_slot + 1]) {
                r_mas->last = mas_safe_pivot(r_mas, r_slot + 1);
                cp_r_slot++;
        }