mirror-linux/drivers/android
Vitaly Wool f56b131723 rust: rbtree: add immutable cursor
Sometimes we may need to iterate over, or find an element in a read
only (or read mostly) red-black tree, and in that case we don't need a
mutable reference to the tree, which we'll however have to take to be
able to use the current (mutable) cursor implementation.

This patch adds a simple immutable cursor implementation to RBTree,
which enables us to use an immutable tree reference. The existing
(fully featured) cursor implementation is renamed to CursorMut,
while retaining its functionality.

The only existing user of the [mutable] cursor for RBTrees (binder) is
updated to match the changes.

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.se>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20251014123339.2492210-1-vitaly.wool@konsulko.se
[ Applied `rustfmt`. Added intra-doc link. Fixed unclosed example.
  Fixed docs description. Fixed typo and other formatting nits.
    - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-11-16 21:56:57 +01:00
..
binder rust: rbtree: add immutable cursor 2025-11-16 21:56:57 +01:00
tests binder: Use seq_buf in binder_alloc kunit tests 2025-07-24 11:42:43 +02:00
Kconfig rust_binder: add Rust Binder driver 2025-09-19 09:40:46 +02:00
Makefile rust_binder: add Rust Binder driver 2025-09-19 09:40:46 +02:00
binder.c binder: add tracepoint for netlink reports 2025-08-19 12:53:02 +02:00
binder_alloc.c binder: Convert binder_alloc selftests to KUnit 2025-07-16 14:11:59 +02:00
binder_alloc.h binder: Convert binder_alloc selftests to KUnit 2025-07-16 14:11:59 +02:00
binder_internal.h binder: add t->is_async and t->is_reply 2025-08-19 12:53:01 +02:00
binder_netlink.c binder: introduce transaction reports via netlink 2025-08-19 12:53:01 +02:00
binder_netlink.h binder: introduce transaction reports via netlink 2025-08-19 12:53:01 +02:00
binder_trace.h binder: add tracepoint for netlink reports 2025-08-19 12:53:02 +02:00
binderfs.c binder: add transaction_report feature entry 2025-08-19 12:53:01 +02:00
dbitmap.h binder: fix double-free in dbitmap 2025-09-18 17:20:00 +02:00