]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: debugfs: support for binary large objects
authorDanilo Krummrich <dakr@kernel.org>
Wed, 22 Oct 2025 14:30:40 +0000 (16:30 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 4 Nov 2025 23:35:40 +0000 (00:35 +0100)
commit9c804d9cf2dbe90cfde89c905b45aacbd07ee537
tree5b2288fdc17e55290f867cb03421b93db3937c5e
parent0ddceba2701e7012646f6df6d32c4e4b7c4dc938
rust: debugfs: support for binary large objects

Introduce support for read-only, write-only, and read-write binary files
in Rust debugfs. This adds:

- BinaryWriter and BinaryReader traits for writing to and reading from
  user slices in binary form.
- New Dir methods: read_binary_file(), write_binary_file(),
  `read_write_binary_file`.
- Corresponding FileOps implementations: BinaryReadFile,
  BinaryWriteFile, BinaryReadWriteFile.

This allows kernel modules to expose arbitrary binary data through
debugfs, with proper support for offsets and partial reads/writes.

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/file_ops.rs
rust/kernel/debugfs/traits.rs