From: Liam R. Howlett Date: Tue, 29 Jan 2019 20:53:03 +0000 (-0500) Subject: maple_tree: Move mas_update_limits X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fbb4d2d1e2c38a2cd6dac92076da6b6405a96c9b;p=users%2Fjedix%2Flinux-maple.git maple_tree: Move mas_update_limits Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 76280416b0313..2443225dbe3be 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