[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260115193647.1695937-23-Liam.Howlett@oracle.com>
Date: Thu, 15 Jan 2026 14:36:41 -0500
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: maple-tree@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Suren Baghdasaryan <surenb@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
Sidhartha Kumar <sidhartha.kumar@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Alice Ryhl <aliceryhl@...gle.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Arnd Bergmann <arnd@...db.de>, Christian Kujau <lists@...dbynature.de>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>
Subject: [PATCH 22/28] maple_tree: Add copy_tree_location() helper
Extract the copying of the tree location from one maple state to another
into its own function. This is used more later.
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
lib/maple_tree.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 50e1d9f585502..a6f4a1c8549b5 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -3500,6 +3500,17 @@ static bool spanning_ascend(struct maple_copy *cp, struct ma_state *mas,
return true;
}
+static inline
+void copy_tree_location(const struct ma_state *src, struct ma_state *dst)
+{
+ dst->node = src->node;
+ dst->offset = src->offset;
+ dst->min = src->min;
+ dst->max = src->max;
+ dst->end = src->end;
+ dst->depth = src->depth;
+}
+
/*
* rebalance_ascend() - Ascend the tree and set up for the next loop - if
* necessary
@@ -3539,12 +3550,7 @@ static inline bool rebalance_ascend(struct maple_copy *cp,
}
cp->height++;
- mas->node = parent->node;
- mas->offset = parent->offset;
- mas->min = parent->min;
- mas->max = parent->max;
- mas->end = parent->end;
- mas->depth = parent->depth;
+ copy_tree_location(parent, mas);
wr_mas_setup(wr_mas, mas);
return true;
}
--
2.47.3
Powered by blists - more mailing lists