]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: debugfs: support blobs from smart pointers
authorDanilo Krummrich <dakr@kernel.org>
Wed, 22 Oct 2025 14:30:41 +0000 (16:30 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 4 Nov 2025 23:35:40 +0000 (00:35 +0100)
commita9fca8a7b2c5078c00960866d2a512b8cea7ce3b
tree458c0c87f6d520b3503144355cc550fe6fe94893
parent9c804d9cf2dbe90cfde89c905b45aacbd07ee537
rust: debugfs: support blobs from smart pointers

Extend Rust debugfs binary support to allow exposing data stored in
common smart pointers and heap-allocated collections.

- Implement BinaryWriter for Box<T>, Pin<Box<T>>, Arc<T>, and Vec<T>.
- Introduce BinaryReaderMut for mutable binary access with outer locks.
- Implement BinaryReaderMut for Box<T>, Vec<T>, and base types.
- Update BinaryReader to delegate to BinaryReaderMut for Mutex<T>,
  Box<T>, Pin<Box<T>> and Arc<T>.

This enables debugfs files to directly expose or update data stored
inside heap-allocated, reference-counted, or lock-protected containers
without manual dereferencing or locking.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Matthew Maurer <mmaurer@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/debugfs.rs
rust/kernel/debugfs/traits.rs