From: Liam R. Howlett Date: Tue, 2 May 2023 00:32:46 +0000 (-0400) Subject: maple_tree: Move setting of end_piv into mas_wr_end_piv() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3c516afe590197c63825488c6bef1b26433e0b60;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bc848d68f8295..36abd3d76cfb5 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)