mast_sufficient()/mast_overflow() are only used in mas_spanning_rebalance(). Before doing the check, mast_ascend() has retrieved the left subtree type and stored in bnode->type. So we can use the type in bnode->type directly to get minimum slot count. Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> CC: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx> CC: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx> CC: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> --- lib/maple_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 6cabee1371ec..56e9857ce681 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2729,7 +2729,7 @@ static inline void mast_combine_cp_right(struct maple_subtree_state *mast) */ static inline bool mast_sufficient(struct maple_subtree_state *mast) { - if (mast->bn->b_end > mt_min_slot_count(mast->orig_l->node)) + if (mast->bn->b_end > mt_min_slots[mast->bn->type]) return true; return false; @@ -2742,7 +2742,7 @@ static inline bool mast_sufficient(struct maple_subtree_state *mast) */ static inline bool mast_overflow(struct maple_subtree_state *mast) { - if (mast->bn->b_end >= mt_slot_count(mast->orig_l->node)) + if (mast->bn->b_end >= mt_slots[mast->bn->type]) return true; return false; -- 2.34.1