maple_tree: Relocate mas_rewalk() and mas_rewalk_if_dead()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 2 May 2023 01:34:19 +0000 (21:34 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 2 May 2023 17:51:57 +0000 (13:51 -0400)
These functions need to move for future use.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 5a6cd0f75d713ddb11f292278802a84cbf65b1e3..6d85dd30031b3232cef9174265381f86a11113ee 100644 (file)
@@ -4524,6 +4524,25 @@ exists:
 
 }
 
+static inline void mas_rewalk(struct ma_state *mas, unsigned long index)
+{
+retry:
+       mas_set(mas, index);
+       mas_state_walk(mas);
+       if (mas_is_start(mas))
+               goto retry;
+}
+
+static inline bool mas_rewalk_if_dead(struct ma_state *mas,
+               struct maple_node *node, const unsigned long index)
+{
+       if (unlikely(ma_dead_node(node))) {
+               mas_rewalk(mas, index);
+               return true;
+       }
+       return false;
+}
+
 /*
  * mas_prev_node() - Find the prev non-null entry at the same level in the
  * tree.  The prev value will be mas->node[mas->offset] or MAS_NONE.
@@ -4706,29 +4725,6 @@ no_entry:
        return 0;
 }
 
-static inline void mas_rewalk(struct ma_state *mas, unsigned long index)
-{
-
-retry:
-       mas_set(mas, index);
-       mas_state_walk(mas);
-       if (mas_is_start(mas))
-               goto retry;
-
-       return;
-
-}
-
-static inline bool mas_rewalk_if_dead(struct ma_state *mas,
-               struct maple_node *node, const unsigned long index)
-{
-       if (unlikely(ma_dead_node(node))) {
-               mas_rewalk(mas, index);
-               return true;
-       }
-       return false;
-}
-
 /*
  * mas_next_slot() - Get the entry in the next slot
  *