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: move maple_subtree_state from mas_wr_spanning_store to mas_wr_spanning_rebalance

Moving the maple_subtree_state is necessary for future cleanups and is
only set up in mas_wr_spanning_rebalance() but never used.

Link: https://lkml.kernel.org/r/20260130205935.2559335-10-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
2fce1c3c 36801595

+21 -20
+21 -20
lib/maple_tree.c
··· 2750 2750 2751 2751 2752 2752 static noinline void mas_wr_spanning_rebalance(struct ma_state *mas, 2753 - struct maple_subtree_state *mast, struct ma_wr_state *wr_mas) 2753 + struct ma_wr_state *wr_mas, struct ma_wr_state *r_wr_mas) 2754 2754 { 2755 + struct maple_subtree_state mast; 2755 2756 struct maple_big_node b_node; 2756 2757 unsigned char height; 2757 2758 MA_STATE(l_mas, mas->tree, mas->index, mas->index); 2758 2759 MA_STATE(r_mas, mas->tree, mas->index, mas->last); 2759 2760 MA_STATE(m_mas, mas->tree, mas->index, mas->index); 2761 + MA_STATE(mast_l_mas, NULL, 0, 0); 2760 2762 2763 + 2764 + mast_l_mas = *mas; 2765 + mast.orig_l = &mast_l_mas; 2766 + mast.orig_r = r_wr_mas->mas; 2761 2767 memset(&b_node, 0, sizeof(struct maple_big_node)); 2762 2768 /* Copy l_mas and store the value in b_node. */ 2763 - mas_store_b_node(wr_mas, &b_node, mast->orig_l->end); 2769 + mas_store_b_node(wr_mas, &b_node, mast.orig_l->end); 2764 2770 /* Copy r_mas into b_node if there is anything to copy. */ 2765 - if (mast->orig_r->max > mast->orig_r->last) 2766 - mas_mab_cp(mast->orig_r, mast->orig_r->offset, 2767 - mast->orig_r->end, &b_node, b_node.b_end + 1); 2771 + if (mast.orig_r->max > mast.orig_r->last) 2772 + mas_mab_cp(mast.orig_r, mast.orig_r->offset, 2773 + mast.orig_r->end, &b_node, b_node.b_end + 1); 2768 2774 else 2769 2775 b_node.b_end++; 2770 2776 2771 2777 /* Stop spanning searches by searching for just index. */ 2772 - mast->orig_l->last = mas->index; 2778 + mast.orig_l->last = mas->index; 2773 2779 2774 - mast->bn = &b_node; 2780 + mast.bn = &b_node; 2775 2781 /* Combine l_mas and r_mas and split them up evenly again. */ 2776 2782 2777 2783 /* 2778 2784 * The tree needs to be rebalanced and leaves need to be kept at the same level. 2779 2785 * Rebalancing is done by use of the ``struct maple_topiary``. 2780 2786 */ 2781 - mast->l = &l_mas; 2782 - mast->m = &m_mas; 2783 - mast->r = &r_mas; 2787 + mast.l = &l_mas; 2788 + mast.m = &m_mas; 2789 + mast.r = &r_mas; 2784 2790 l_mas.status = r_mas.status = m_mas.status = ma_none; 2785 2791 2786 2792 /* Check if this is not root and has sufficient data. */ 2787 - if (((mast->orig_l->min != 0) || (mast->orig_r->max != ULONG_MAX)) && 2788 - unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) 2789 - mast_spanning_rebalance(mast); 2793 + if (((mast.orig_l->min != 0) || (mast.orig_r->max != ULONG_MAX)) && 2794 + unlikely(mast.bn->b_end <= mt_min_slots[mast.bn->type])) 2795 + mast_spanning_rebalance(&mast); 2790 2796 2791 2797 height = mas_mt_height(mas) + 1; 2792 - mas_spanning_rebalance_loop(mas, mast, height); 2798 + mas_spanning_rebalance_loop(mas, &mast, height); 2793 2799 } 2794 2800 /* 2795 2801 * mas_rebalance() - Rebalance a given node. ··· 3453 3447 */ 3454 3448 static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) 3455 3449 { 3456 - struct maple_subtree_state mast; 3457 3450 struct ma_state *mas; 3458 3451 3459 3452 /* Left and Right side of spanning store */ 3460 - MA_STATE(l_mas, NULL, 0, 0); 3461 3453 MA_STATE(r_mas, NULL, 0, 0); 3462 3454 MA_WR_STATE(r_wr_mas, &r_mas, wr_mas->entry); 3463 3455 ··· 3509 3505 return mas_new_root(mas, wr_mas->entry); 3510 3506 } 3511 3507 3512 - l_mas = *mas; 3513 - mast.orig_l = &l_mas; 3514 - mast.orig_r = &r_mas; 3515 - mas_wr_spanning_rebalance(mas, &mast, wr_mas); 3508 + mas_wr_spanning_rebalance(mas, wr_mas, &r_wr_mas); 3516 3509 } 3517 3510 3518 3511 /*