]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Move setting of end_piv into mas_wr_end_piv()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 2 May 2023 00:32:46 +0000 (20:32 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 2 May 2023 03:00:31 +0000 (23:00 -0400)
When settingup the maple write state, set the end pivot.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index bc848d68f8295df820a51ca5c3003e85f8828cee..36abd3d76cfb5dca74c74562831b02203d7c4ee7 100644 (file)
@@ -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)