]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: maple_tree: add MapleTreeAlloc
authorAlice Ryhl <aliceryhl@google.com>
Tue, 2 Sep 2025 08:35:13 +0000 (08:35 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 21 Sep 2025 21:22:19 +0000 (14:22 -0700)
commit56b1852e82bd5550c8987bb381a3d930f27b4058
tree9858a4d898612674a1d3496a0e4747985901f32c
parent01422da19cbeb4b044649322968265464991368e
rust: maple_tree: add MapleTreeAlloc

To support allocation trees, we introduce a new type MapleTreeAlloc for
the case where the tree is created using MT_FLAGS_ALLOC_RANGE.  To ensure
that you can only call mtree_alloc_range on an allocation tree, we
restrict thta method to the new MapleTreeAlloc type.  However, all methods
on MapleTree remain accessible to MapleTreeAlloc as allocation trees can
use the other methods without issues.

Link: https://lkml.kernel.org/r/20250902-maple-tree-v3-3-fb5c8958fb1e@google.com
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Andrew Ballance <andrewjballance@gmail.com>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
rust/kernel/maple_tree.rs