]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: drop mas_next_slot and mas_prev_slot - unused
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 17 Jul 2020 21:28:43 +0000 (17:28 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:05:33 +0000 (15:05 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index ed9870742617af6d07ba96c1017b42defb551efa..9cad1d1b3e2c909aa928fb88e69a3737cb7ac6c7 100644 (file)
@@ -2963,106 +2963,6 @@ void *mas_store(struct ma_state *mas, void *entry)
 
 }
 static inline int mas_dead_node(struct ma_state *mas, unsigned long index);
-
-static inline void mas_next_slot(struct ma_state *mas, unsigned long max)
-       __must_hold(mas->tree->lock)
-{
-       unsigned char slot;
-
-       while (1) {
-               slot = mte_parent_slot(mas->node);
-               if (mte_is_root(mas->node))
-                       goto no_entry;
-
-               mas_ascend(mas);
-               if (mas->max > max)
-                       goto no_entry;
-
-               if (slot < mt_slot_count(mas->node) - 1) {
-                       if (!mas_get_safe_pivot(mas, slot + 1))
-                               continue;
-                       slot++;
-                       goto walk_down;
-               }
-
-               if (mte_is_root(mas->node))
-                       goto no_entry;
-       }
-
-walk_down:
-       do {
-               void *entry = NULL;
-               if (slot)
-                       mas->min = mas_get_safe_pivot(mas, slot - 1) + 1;
-               mas->max = mas_get_safe_pivot(mas, slot);
-               entry = mas_get_rcu_slot(mas, slot);
-               mas->node = entry;
-               if (mt_is_empty(mas->node))
-                       goto no_entry;
-
-               if (mte_is_leaf(mas->node)) {
-                       goto found_next;
-               }
-               slot = 0;
-
-       } while (1);
-
-found_next:
-       mas_set_slot(mas, slot);
-       return;
-
-no_entry:
-       mas->node = MAS_NONE;
-}
-/** Private
- * mas_prev_slot() - Find the previous leaf slot, regardless of having an
- * entry or not
- *
- * NOTE: Not read safe - does not check for dead nodes.
- *       Not root safe, cannot be the root node.
- */
-static inline void mas_prev_slot(struct ma_state *mas, unsigned long min)
-       __must_hold(ms->tree->lock)
-{
-       unsigned char slot;
-
-       if (mte_is_root(mas->node))
-               goto no_entry;
-
-       while (1) {
-               slot = mte_parent_slot(mas->node);
-               mas_ascend(mas);
-               if (mas->min < min)
-                       goto no_entry;
-
-               if (slot) {
-                       slot--;
-                       goto walk_down;
-               }
-               if (mte_is_root(mas->node))
-                       goto no_entry;
-       }
-
-walk_down:
-       do {
-               if (slot)
-                       mas->min = mas_get_safe_pivot(mas, slot - 1);
-               mas->max = mas_get_safe_pivot(mas, slot);
-               mas->node = mas_get_rcu_slot(mas, slot);
-               if (mte_is_leaf(mas->node))
-                       goto done;
-
-               slot = _mas_data_end(mas, mte_node_type(mas->node), &mas->max);
-       } while (1);
-
-done:
-       mas_set_slot(mas, slot);
-       return;
-
-no_entry:
-       mas->node = MAS_NONE;
-}
-
 /** Private
  * mas_prev_node() - Find the prev non-null entry at the same level in the
  * tree.  The prev value will be mas->node[mas_get_slot(mas)] or MAS_NONE.