Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

maple_tree: remove l_wr_mas from mas_wr_spanning_rebalance

Use the wr_mas instead of creating another variable on the stack. Take
the opportunity to remove l_mas from being used anywhere but in the
maple_subtree_state.

Link: https://lkml.kernel.org/r/20260130205935.2559335-8-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Andrew Ballance <andrewjballance@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Kujau <lists@nerdbynature.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Liam R. Howlett and committed by
Andrew Morton
41bcc348 3dd3dbaa

+8 -11
+8 -11
lib/maple_tree.c
··· 2751 2751 2752 2752 static noinline void mas_wr_spanning_rebalance(struct ma_state *mas, 2753 2753 struct maple_subtree_state *mast, unsigned char height, 2754 - struct ma_wr_state *l_wr_mas) 2754 + struct ma_wr_state *wr_mas) 2755 2755 { 2756 2756 struct maple_big_node b_node; 2757 2757 MA_STATE(l_mas, mas->tree, mas->index, mas->index); ··· 2760 2760 2761 2761 memset(&b_node, 0, sizeof(struct maple_big_node)); 2762 2762 /* Copy l_mas and store the value in b_node. */ 2763 - mas_store_b_node(l_wr_mas, &b_node, mast->orig_l->end); 2763 + mas_store_b_node(wr_mas, &b_node, mast->orig_l->end); 2764 2764 /* Copy r_mas into b_node if there is anything to copy. */ 2765 2765 if (mast->orig_r->max > mast->orig_r->last) 2766 2766 mas_mab_cp(mast->orig_r, mast->orig_r->offset, ··· 3454 3454 MA_STATE(l_mas, NULL, 0, 0); 3455 3455 MA_STATE(r_mas, NULL, 0, 0); 3456 3456 MA_WR_STATE(r_wr_mas, &r_mas, wr_mas->entry); 3457 - MA_WR_STATE(l_wr_mas, &l_mas, wr_mas->entry); 3458 3457 3459 3458 /* 3460 3459 * A store operation that spans multiple nodes is called a spanning ··· 3493 3494 r_mas.last = r_mas.index = mas->last; 3494 3495 3495 3496 /* Set up left side. */ 3496 - l_mas = *mas; 3497 - mas_wr_walk_index(&l_wr_mas); 3497 + mas_wr_walk_index(wr_mas); 3498 3498 3499 3499 if (!wr_mas->entry) { 3500 - mas_extend_spanning_null(&l_wr_mas, &r_wr_mas); 3501 - mas->offset = l_mas.offset; 3502 - mas->index = l_mas.index; 3503 - mas->last = l_mas.last = r_mas.last; 3500 + mas_extend_spanning_null(wr_mas, &r_wr_mas); 3501 + mas->last = r_mas.last; 3504 3502 } 3505 3503 3506 3504 /* expanding NULLs may make this cover the entire range */ 3507 - if (!l_mas.index && r_mas.last == ULONG_MAX) { 3505 + if (!mas->index && r_mas.last == ULONG_MAX) { 3508 3506 mas_set_range(mas, 0, ULONG_MAX); 3509 3507 return mas_new_root(mas, wr_mas->entry); 3510 3508 } 3511 3509 3510 + l_mas = *mas; 3512 3511 mast.orig_l = &l_mas; 3513 3512 mast.orig_r = &r_mas; 3514 - mas_wr_spanning_rebalance(mas, &mast, height + 1, &l_wr_mas); 3513 + mas_wr_spanning_rebalance(mas, &mast, height + 1, wr_mas); 3515 3514 } 3516 3515 3517 3516 /*