]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Rename _mas_awalk() to mas_anode_descend() and fix potential error skip
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Nov 2021 16:51:25 +0000 (11:51 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Nov 2021 16:51:25 +0000 (11:51 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 43c378554441d8d5e784eae521b2d6f4295d7195..6522b407c02384984b1c1b537f8f520ffd461b3b 100644 (file)
@@ -4953,7 +4953,7 @@ ascend:
        return false;
 }
 
-static inline bool _mas_awalk(struct ma_state *mas, unsigned long size)
+static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size)
 {
        enum maple_type type = mte_node_type(mas->node);
        unsigned long pivot, min, gap = 0;
@@ -4999,6 +4999,8 @@ static inline bool _mas_awalk(struct ma_state *mas, unsigned long size)
                                mas->min = min;
                                mas->max = pivot;
                                offset = 0;
+                               type = mte_node_type(mas->node);
+                               count = mt_slots[type];
                                break;
                        }
                }
@@ -5116,7 +5118,7 @@ static inline void mas_awalk(struct ma_state *mas, unsigned long size)
         * no gap found. (return, slot == MAPLE_NODE_SLOTS)
         * found the gap. (return, slot != MAPLE_NODE_SLOTS)
         */
-       while (!mas_is_err(mas) && !_mas_awalk(mas, size)) {
+       while (!mas_is_err(mas) && !mas_anode_descend(mas, size)) {
                if (last == mas->node)
                        mas_skip_node(mas);
                else