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: extract use of big node from mas_wr_spanning_store()

Isolate big node to use in its own function.

No functional changes intended.

Link: https://lkml.kernel.org/r/20260130205935.2559335-4-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
df11f9ee 3e302560

+26 -18
+26 -18
lib/maple_tree.c
··· 2748 2748 mas_spanning_rebalance_loop(mas, mast, count); 2749 2749 } 2750 2750 2751 + 2752 + static noinline void mas_wr_spanning_rebalance(struct ma_state *mas, 2753 + struct maple_subtree_state *mast, unsigned char height, 2754 + struct ma_wr_state *l_wr_mas) 2755 + { 2756 + struct maple_big_node b_node; 2757 + 2758 + memset(&b_node, 0, sizeof(struct maple_big_node)); 2759 + /* Copy l_mas and store the value in b_node. */ 2760 + mas_store_b_node(l_wr_mas, &b_node, mast->orig_l->end); 2761 + /* Copy r_mas into b_node if there is anything to copy. */ 2762 + if (mast->orig_r->max > mast->orig_r->last) 2763 + mas_mab_cp(mast->orig_r, mast->orig_r->offset, 2764 + mast->orig_r->end, &b_node, b_node.b_end + 1); 2765 + else 2766 + b_node.b_end++; 2767 + 2768 + /* Stop spanning searches by searching for just index. */ 2769 + mast->orig_l->index = mast->orig_l->last = mas->index; 2770 + 2771 + mast->bn = &b_node; 2772 + /* Combine l_mas and r_mas and split them up evenly again. */ 2773 + return mas_spanning_rebalance(mas, mast, height); 2774 + } 2751 2775 /* 2752 2776 * mas_rebalance() - Rebalance a given node. 2753 2777 * @mas: The maple state ··· 3424 3400 * span. 3425 3401 * @wr_mas: The maple write state 3426 3402 */ 3427 - static noinline void mas_wr_spanning_store(struct ma_wr_state *wr_mas) 3403 + static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) 3428 3404 { 3429 3405 struct maple_subtree_state mast; 3430 - struct maple_big_node b_node; 3431 3406 struct ma_state *mas; 3432 3407 unsigned char height; 3433 3408 ··· 3490 3467 return mas_new_root(mas, wr_mas->entry); 3491 3468 } 3492 3469 3493 - memset(&b_node, 0, sizeof(struct maple_big_node)); 3494 - /* Copy l_mas and store the value in b_node. */ 3495 - mas_store_b_node(&l_wr_mas, &b_node, l_mas.end); 3496 - /* Copy r_mas into b_node if there is anything to copy. */ 3497 - if (r_mas.max > r_mas.last) 3498 - mas_mab_cp(&r_mas, r_mas.offset, r_mas.end, 3499 - &b_node, b_node.b_end + 1); 3500 - else 3501 - b_node.b_end++; 3502 - 3503 - /* Stop spanning searches by searching for just index. */ 3504 - l_mas.index = l_mas.last = mas->index; 3505 - 3506 - mast.bn = &b_node; 3507 3470 mast.orig_l = &l_mas; 3508 3471 mast.orig_r = &r_mas; 3509 - /* Combine l_mas and r_mas and split them up evenly again. */ 3510 - return mas_spanning_rebalance(mas, &mast, height + 1); 3472 + mas_wr_spanning_rebalance(mas, &mast, height + 1, &l_wr_mas); 3511 3473 } 3512 3474 3513 3475 /*