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: inline mas_spanning_rebalance() into mas_wr_spanning_rebalance()

Copy the contents of mas_spanning_rebalance() into
mas_wr_spanning_rebalance(), in preparation of removing initial big node
use.

No functional changes intended.

Link: https://lkml.kernel.org/r/20260130205935.2559335-6-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
6f2e5221 a2ac9935

+19 -1
+19 -1
lib/maple_tree.c
··· 2754 2754 struct ma_wr_state *l_wr_mas) 2755 2755 { 2756 2756 struct maple_big_node b_node; 2757 + MA_STATE(l_mas, mas->tree, mas->index, mas->index); 2758 + MA_STATE(r_mas, mas->tree, mas->index, mas->last); 2759 + MA_STATE(m_mas, mas->tree, mas->index, mas->index); 2757 2760 2758 2761 memset(&b_node, 0, sizeof(struct maple_big_node)); 2759 2762 /* Copy l_mas and store the value in b_node. */ ··· 2773 2770 2774 2771 mast->bn = &b_node; 2775 2772 /* Combine l_mas and r_mas and split them up evenly again. */ 2776 - return mas_spanning_rebalance(mas, mast, height); 2773 + 2774 + /* 2775 + * The tree needs to be rebalanced and leaves need to be kept at the same level. 2776 + * Rebalancing is done by use of the ``struct maple_topiary``. 2777 + */ 2778 + mast->l = &l_mas; 2779 + mast->m = &m_mas; 2780 + mast->r = &r_mas; 2781 + l_mas.status = r_mas.status = m_mas.status = ma_none; 2782 + 2783 + /* Check if this is not root and has sufficient data. */ 2784 + if (((mast->orig_l->min != 0) || (mast->orig_r->max != ULONG_MAX)) && 2785 + unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) 2786 + mast_spanning_rebalance(mast); 2787 + 2788 + mas_spanning_rebalance_loop(mas, mast, height); 2777 2789 } 2778 2790 /* 2779 2791 * mas_rebalance() - Rebalance a given node.