Re: [PATCH v2 4/6] rust: rbtree: add `RBTreeIteratorMut`

From: Benno Lossin
Date: Thu Mar 14 2024 - 12:27:44 EST


On 2/19/24 12:48, Matt Gilbride wrote:
> From: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
>
> Add mutable Iterator implementation (`RBTreeIteratorMut`) 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@xxxxxxxxxx/ [1]
> Signed-off-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
> Signed-off-by: Matt Gilbride <mattgilbride@xxxxxxxxxx>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Tested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

The comments from patch 3 also apply here.

--
Cheers,
Benno