From: Sidhartha Kumar Date: Thu, 18 Apr 2024 21:40:05 +0000 (-0700) Subject: maple_tree: simplify mas_commit_b_node() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0bb30b25ac54e7e704d55ef86eff6b384f4c0cf2;p=users%2Fjedix%2Flinux-maple.git maple_tree: simplify mas_commit_b_node() Use mas->store_type to simplify the logic of identifying the type of write. Signed-off-by: Sidhartha Kumar --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9770c53a87a49..e6e7ce66c2680 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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))