]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Add missing mas_walk() which is part of the interface
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 29 Sep 2020 13:35:46 +0000 (09:35 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:12:39 +0000 (15:12 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index f31c7399dd25e52e9bbfb61f946c6658a468e2ed..88a783be04d77e96f214d451be90bba9608b71c5 100644 (file)
@@ -3720,6 +3720,7 @@ static inline bool _mas_walk(struct ma_state *mas, unsigned long *range_min,
        return __mas_walk(mas, range_min, range_max);
 }
 
+
 static inline int mas_dead_node(struct ma_state *mas, unsigned long index)
 {
        unsigned long range_max, range_min;
@@ -3736,6 +3737,19 @@ static inline int mas_dead_node(struct ma_state *mas, unsigned long index)
        return 1;
 }
 
+void *mas_walk(struct ma_state *mas)
+{
+       unsigned long range_min, range_max;
+       unsigned long index = mas->index;
+
+       _mas_walk(mas, &range_min, &range_max);
+retry:
+       if (mas_dead_node(mas, index))
+               goto retry;
+
+       return mas_get_slot(mas, mas_offset(mas));
+}
+
 static inline bool mas_search_cont(struct ma_state *mas, unsigned long index,
                unsigned long max, void *entry)
 {