From 6609bd4fde20eec1caab54e49aa12ab4f56ac3f9 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 17 Jul 2020 17:28:43 -0400 Subject: [PATCH] maple_tree: drop mas_next_slot and mas_prev_slot - unused Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 100 ----------------------------------------------- 1 file changed, 100 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ed9870742617..9cad1d1b3e2c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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. -- 2.50.1