From 3c516afe590197c63825488c6bef1b26433e0b60 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 1 May 2023 20:32:46 -0400 Subject: [PATCH] maple_tree: Move setting of end_piv into mas_wr_end_piv() When settingup the maple write state, set the end pivot. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bc848d68f829..36abd3d76cfb 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4285,6 +4285,8 @@ done: static inline void mas_wr_end_piv(struct ma_wr_state *wr_mas) { + wr_mas->end_piv = wr_mas->r_max; + while ((wr_mas->mas->last > wr_mas->end_piv) && (wr_mas->offset_end < wr_mas->node_end)) wr_mas->end_piv = wr_mas->pivots[++wr_mas->offset_end]; @@ -4446,7 +4448,6 @@ static inline void *mas_wr_store_entry(struct ma_wr_state *wr_mas) } /* At this point, we are at the leaf node that needs to be altered. */ - wr_mas->end_piv = wr_mas->r_max; mas_wr_end_piv(wr_mas); if (!wr_mas->entry) -- 2.50.1