linux/rust/kernel/debugfs
Matthew Maurer 40ecc49466 rust: debugfs: Add support for callback-based files
Extends the `debugfs` API to support creating files with content
generated and updated by callbacks. This is done via the
`read_callback_file`, `write_callback_file`, and
`read_write_callback_file` methods.

These methods allow for more flexible file definition, either because
the type already has a `Writer` or `Reader` method that doesn't
do what you'd like, or because you cannot implement it (e.g. because
it's a type defined in another crate or a primitive type).

Signed-off-by: Matthew Maurer <mmaurer@google.com>
Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250904-debugfs-rust-v11-4-7d12a165685a@google.com
[ Fix up Result<(), Error> -> Result. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2025-09-10 18:58:21 +02:00
..
callback_adapters.rs rust: debugfs: Add support for callback-based files 2025-09-10 18:58:21 +02:00
entry.rs
file_ops.rs rust: debugfs: Add support for callback-based files 2025-09-10 18:58:21 +02:00
traits.rs rust: debugfs: Add support for writable files 2025-09-10 18:58:16 +02:00