[PATCH 5/7] maple_tree: the type of left subtree is already saved in bnode->type
Wei Yang
richard.weiyang at gmail.com
Tue Nov 26 17:27:51 PST 2024
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 at gmail.com>
CC: Liam R. Howlett <Liam.Howlett at Oracle.com>
CC: Sidhartha Kumar <sidhartha.kumar at oracle.com>
CC: Lorenzo Stoakes <lorenzo.stoakes at oracle.com>
---
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
More information about the maple-tree
mailing list