]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Move mas_update_limits
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 29 Jan 2019 20:53:03 +0000 (15:53 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 31 Jul 2019 14:52:38 +0000 (10:52 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 76280416b03131bdb07425e04bce25c4f2805a07..2443225dbe3bedd7248f7131877cb2a5b8dc89bf 100644 (file)
@@ -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