diff options
author | Tamir Duberstein <tamird@gmail.com> | 2025-04-23 09:54:38 -0400 |
---|---|---|
committer | Andreas Hindborg <a.hindborg@kernel.org> | 2025-05-01 11:37:59 +0200 |
commit | 210b81578efbe5c5e7748e50d313e1a90b03df55 (patch) | |
tree | 54f30a53c6484fad38bda0d6d98ba2bd3f987eea /rust/kernel/lib.rs | |
parent | 1a4736c3d8394f5e64557a41b4b2b8d6dcd04622 (diff) |
rust: xarray: Add an abstraction for XArray
`XArray` is an efficient sparse array of pointers. Add a Rust
abstraction for this type.
This implementation bounds the element type on `ForeignOwnable` and
requires explicit locking for all operations. Future work may leverage
RCU to enable lockless operation.
Inspired-by: MaĆra Canal <mcanal@igalia.com>
Inspired-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://lore.kernel.org/r/20250423-rust-xarray-bindings-v19-2-83cdcf11c114@gmail.com
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Diffstat (limited to 'rust/kernel/lib.rs')
-rw-r--r-- | rust/kernel/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index de07aadd1ff5..715fab6b1345 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -88,6 +88,7 @@ pub mod transmute; pub mod types; pub mod uaccess; pub mod workqueue; +pub mod xarray; #[doc(hidden)] pub use bindings; |