maple_tree: remove mast_overflow.
Subsystems (3)
PATCH 1/1 maple_tree: remove mast_overflow.
mast_overflow is used only in mas_spanning_rebalance.
But when mast_sufficient is false, mast_overflow always returns false, and when mast_suffictent is true, it never reaches to mast_overflow in mas_spanning_rebalance.
Therefore, mast_overflow is dead code in mas_spanning_rebalance. And there is no other usage of mast_overflow execpt mas_spanning_rebalance, Remove mast_overflow.
--- lib/maple_tree.c | 16 ---------------- 1 file changed, 16 deletions(-)
lib/maple_tree.c +0 -16
@@ -2767,19 +2767,6 @@ static inline bool mast_sufficient(struct maple_subtree_state *mast)return false; } -/* -* mast_overflow: Check if there is too much data in the subtree state for a -* single node. -* @mast: The maple subtree state -*/ -static inline bool mast_overflow (struct maple_subtree_state *mast) -{ -if (mast->bn->b_end >=mt_slot_count (mast->orig_l->node)) -return true; - -return false; -} -static inline void *mtree_range_walk (struct ma_state *mas) {unsigned long *pivots;
@@ -2934,9 +2921,6 @@ static int mas_spanning_rebalance(struct ma_state *mas,if (mast_sufficient (mast))continue ; -if (mast_overflow (mast)) -continue ; -/* May be a new root stored in mast->bn */ if (mas_is_root_limits (mast->orig_l))break ;
Signature · 1 line
2.41.0
Liam R. Howlett
NAKQuoted 2 lines · Levi Yun
mast_overflowis used only inmas_spanning_rebalance.
But whenmast_sufficientis false,mast_overflowalways returns false,
NACK
mast_sufficient checks the mt_min_slot_count() against the end while mast_overflow checks the mt_slot_count() against the end.
Quoted 49 lines
and when
mast_suffictentis true, it never reaches tomast_overflowinmas_spanning_rebalance.Therefore,
mast_overflowis dead code inmas_spanning_rebalance. And there is no other usage ofmast_overflowexecptmas_spanning_rebalance, Removemast_overflow.Signed-off-by Levi Yun <[email protected]>--- lib/maple_tree.c | 16 ---------------- 1 file changed, 16 deletions(-)lib/maple_tree.c +0
-16@@ -2767,19 +2767,6 @@ static inline bool mast_sufficient(struct maple_subtree_state *mast)return false; } -/* -* mast_overflow: Check if there is too much data in the subtree state for a -* single node. -* @mast: The maple subtree state -*/ -static inline bool mast_overflow (struct maple_subtree_state *mast) -{ -if (mast->bn->b_end >=mt_slot_count (mast->orig_l->node)) -return true; - -return false; -} -static inline void *mtree_range_walk (struct ma_state *mas) {unsigned long *pivots;@@ -2934,9 +2921,6 @@ static int mas_spanning_rebalance(struct ma_state *mas,if (mast_sufficient (mast))continue ; -if (mast_overflow (mast)) -continue ; -/* May be a new root stored in mast->bn */ if (mas_is_root_limits (mast->orig_l))break ;Signature · 1 line
2.41.0