]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: simplify mas_commit_b_node()
authorSidhartha Kumar <sidhartha.kumar@oracle.com>
Thu, 18 Apr 2024 21:40:05 +0000 (14:40 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Sat, 20 Apr 2024 01:40:09 +0000 (21:40 -0400)
Use mas->store_type to simplify the logic of identifying the type of
write.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
lib/maple_tree.c

index 9770c53a87a49cd95304bf59995da928cbf3e218..e6e7ce66c2680fe930db79ba6eb888031aeee688 100644 (file)
@@ -3439,12 +3439,10 @@ static noinline_for_kasan int mas_commit_b_node(struct ma_wr_state *wr_mas,
        enum maple_type b_type = b_node->type;
 
        old_enode = wr_mas->mas->node;
-       if ((b_end < mt_min_slots[b_type]) &&
-           (!mte_is_root(old_enode)) &&
-           (mas_mt_height(wr_mas->mas) > 1))
+       if (wr_mas->mas->store_type == wr_rebalance)
                return mas_rebalance(wr_mas->mas, b_node);
 
-       if (b_end >= mt_slots[b_type])
+       if (wr_mas->mas->store_type == wr_split_store)
                return mas_split(wr_mas->mas, b_node);
 
        if (mas_reuse_node(wr_mas, b_node, end))