Commit 5e40b591 authored by Matthew Maurer's avatar Matthew Maurer Committed by Danilo Krummrich
Browse files

rust: debugfs: Add support for read-only files



Extends the `debugfs` API to support creating read-only files. This
is done via the `Dir::read_only_file` method, which takes a data object
that implements the `Writer` trait.

The file's content is generated by the `Writer` implementation, and the
file is automatically removed when the returned `File` handle is
dropped.

Signed-off-by: default avatarMatthew Maurer <mmaurer@google.com>
Tested-by: default avatarDirk Behme <dirk.behme@de.bosch.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250904-debugfs-rust-v11-2-7d12a165685a@google.com


[ Fixup build failure when CONFIG_DEBUGFS=n. - Danilo ]
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent 7f201ca1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment