]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix resetting depth to preserve depth for external mas calls
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 28 Sep 2020 19:19:36 +0000 (15:19 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:30:29 +0000 (12:30 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index e010b788189311c4d50b4ca295f2cfd7aabdafc2..2c17eef5a426c1f21286955dbce1bdab5a15dd29 100644 (file)
@@ -1013,6 +1013,7 @@ static inline struct maple_enode *mas_start(struct ma_state *mas)
                mas->node = MAS_NONE;
                mas->min = 0;
                mas->max = ULONG_MAX;
+               mas->depth = 0;
                mas_set_offset(mas, 0);
                if (!mas->tree->ma_root) // empty tree.
                        goto done;
@@ -2824,7 +2825,6 @@ bool mas_wr_walk(struct ma_state *mas, unsigned long *range_min,
        enum maple_type type;
 
        mas->span_enode = NULL;
-       mas->depth = 0;
        while (true) {
                type = mte_node_type(mas->node);
                mas->depth++;