From 6b35ac82a8abcaf73e48f1ed5db60b5bb40831e1 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 29 Jan 2019 15:53:03 -0500 Subject: [PATCH] maple_tree: Move mas_update_limits Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 76280416b031..2443225dbe3b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -185,7 +185,23 @@ static inline bool ma_is_root(struct maple_node *node) return false; } -static void mas_update_limits(struct ma_state *ms, unsigned char slot); +static void mas_update_limits(struct ma_state *ms, unsigned char slot) +{ + struct maple_range_64 *mr64; + + if (slot >= MAPLE_NODE_SLOTS) + return; + + if (mas_is_start(ms)) + return; + + mr64 = &mt_to_node(ms->node)->mr64; + if (slot > 0) + ms->min = mr64->pivot[slot - 1] + 1; + + if (slot < MAPLE_RANGE64_SLOTS - 1) + ms->max = mr64->pivot[slot]; +} static inline void ma_encoded_parent(struct ma_state *mas) { struct maple_node *parent, *gparent; @@ -743,23 +759,6 @@ static void ma_root_expand(struct ma_state *ms, void *entry) rcu_assign_pointer(ms->tree->ma_root, mt_mk_root(ms->node)); } -static void mas_update_limits(struct ma_state *ms, unsigned char slot) -{ - struct maple_range_64 *mr64; - - if (slot >= MAPLE_NODE_SLOTS) - return; - - if (mas_is_start(ms)) - return; - - mr64 = &mt_to_node(ms->node)->mr64; - if (slot > 0) - ms->min = mr64->pivot[slot - 1] + 1; - - if (slot < MAPLE_RANGE64_SLOTS - 1) - ms->max = mr64->pivot[slot]; -} /* Private * Combine nulls with the same pivot value * Note: The mas->node will most likely be changed, so keep track of the old -- 2.50.1