From: Liam R. Howlett Date: Tue, 29 Sep 2020 13:35:46 +0000 (-0400) Subject: maple_tree: Add missing mas_walk() which is part of the interface X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a3f93f45e2b15d247a19459f97ce94bd10b3716d;p=users%2Fjedix%2Flinux-maple.git maple_tree: Add missing mas_walk() which is part of the interface Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f31c7399dd25..88a783be04d7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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) {