diff mbox series

[1/4] maple_tree: not necessary to copy mas->end + 1

Message ID 20240919234832.24237-2-richard.weiyang@gmail.com (mailing list archive)
State New
Headers show
Series refine mas_end of mas_mab_cp() | expand

Commit Message

Wei Yang Sept. 19, 2024, 11:48 p.m. UTC
mas_mab_cp() copy range [mas_start, mas_end] inclusively, so we just
need to copy to mas->end which points to the last valid data in maple
node.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 lib/maple_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index a4796101decc..51f49b29b8b0 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -2099,7 +2099,7 @@  static noinline_for_kasan void mas_store_b_node(struct ma_wr_state *wr_mas,
 		goto b_end;
 
 	/* Copy end data to the end of the node. */
-	mas_mab_cp(mas, slot, mas->end + 1, b_node, ++b_end);
+	mas_mab_cp(mas, slot, mas->end, b_node, ++b_end);
 	b_node->b_end--;
 	return;