summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLiam R. Howlett <Liam.Howlett@oracle.com>2026-01-30 15:59:29 -0500
committerAndrew Morton <akpm@linux-foundation.org>2026-04-05 13:52:56 -0700
commit0abff2081983e5dfa7642ab1a794afc0a8417070 (patch)
treed44e549183865f5897c09e72aeadf135a92bba02 /lib
parentebfee00c0bc8295b4dd8281f792f44d38b2af0c7 (diff)
downloadlinux-next-0abff2081983e5dfa7642ab1a794afc0a8417070.tar.gz
linux-next-0abff2081983e5dfa7642ab1a794afc0a8417070.zip
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. Link: https://lkml.kernel.org/r/20260130205935.2559335-25-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>
Diffstat (limited to 'lib')
-rw-r--r--lib/maple_tree.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 7ce7c0a33943..86072bfc2419 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -3531,6 +3531,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
@@ -3570,12 +3581,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;
}