]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: rbtree: add mutable iterator
authorWedson Almeida Filho <wedsonaf@gmail.com>
Thu, 22 Aug 2024 16:37:55 +0000 (16:37 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Sat, 31 Aug 2024 15:36:19 +0000 (17:36 +0200)
commitcf5397d1776489e1c66b7db01f6a58c431ab08f1
treea751eacaa160faa4737ea12e6a549e5b74a9eb83
parente601f1bb8e859758289b1c52503bc626168fba59
rust: rbtree: add mutable iterator

Add mutable Iterator implementation for `RBTree`,
allowing iteration over (key, value) pairs in key order. Only values are
mutable, as mutating keys implies modifying a node's position in the tree.

Mutable iteration is used by the binder driver during shutdown to
clean up the tree maintained by the "range allocator" [1].

Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-6-08ba9197f637@google.com/
Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Signed-off-by: Matt Gilbride <mattgilbride@google.com>
Link: https://lore.kernel.org/r/20240822-b4-rbtree-v12-3-014561758a57@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/rbtree.rs