]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: awalk is still massive
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Sat, 18 Jul 2020 00:23:12 +0000 (20:23 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:05:34 +0000 (15:05 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 9cad1d1b3e2c909aa928fb88e69a3737cb7ac6c7..1f4ba438dbefce895ab9015e257c59c55f17764d 100644 (file)
@@ -3118,9 +3118,6 @@ no_entry:
 
 }
 
-
-
-
 /** Private
  * prev node entry
  */
@@ -3415,21 +3412,15 @@ static inline bool _mas_rev_awalk(struct ma_state *mas, unsigned long size)
 
                        this_gap += max - min + 1;
                        if (this_gap >= size) {
-                               /* within range and large enough */
-                               if (mas->last - min + 1 < size) {
-                                       /* It is possible that the gap is
-                                        * sufficient and within range, but
-                                        * the size does not fit within the
-                                        * maximum value and the min of gap
-                                        */
+                               if (mas->last - min + 1 < size)
                                        goto next_slot;
-                               }
                                mas->min = min;
                                mas->max = min + this_gap - 1;
                                i = start;
                                found = true;
                                break;
                        }
+
 next_slot:
                        if (!i)
                                goto ascend;
@@ -3451,7 +3442,6 @@ next_slot:
                        if (mas->last < min)
                                goto next;
 
-
                        /* index is too large for this range */
                        if (mas->index > max) {
                                mas_set_err(mas, -EBUSY);
@@ -3466,7 +3456,6 @@ next_slot:
                        break;
 
 next:
-                       /* Not found in this node.*/
                        if (!i)
                                goto ascend;
 
@@ -3479,25 +3468,22 @@ next:
                break;
 
        case maple_dense:
-               // FIXME: find a line of nulls...
                i = mas->index - mas->min;
                found = true;
                break;
        }
 
-
        if (!ma_is_leaf(type)) { //descend
                struct maple_enode *next;
 
                next = mas_get_rcu_slot(mas, i);
                mas->min = min;
                mas->max = max;
-               if (!mt_is_empty(next)) {
-                       mas->node = next;
-                       i = _mas_data_end(mas, mte_node_type(next), &max);
-               } else {
+               if (mt_is_empty(next))
                        goto ascend;
-               }
+
+               mas->node = next;
+               i = _mas_data_end(mas, mte_node_type(next), &max);
        }
 
        mas_set_slot(mas, i);