Re: [PATCH v11 7/7] samples: rust: Add scoped debugfs sample driver

From: Greg Kroah-Hartman
Date: Mon Sep 08 2025 - 09:04:45 EST


On Thu, Sep 04, 2025 at 09:13:58PM +0000, Matthew Maurer wrote:
> Adds a new sample driver `rust_scoped_debugfs` that demonstrates the
> use of the scoped debugfs APIs.
>
> The driver creates a `control` directory with two write-only files,
> `create` and `remove`. Writing a name and a series of numbers to
> `create` will create a new subdirectory under a `dynamic` directory.
> This new subdirectory will contain files that expose the numbers as
> atomic values.
>
> Writing a name to `remove` will remove the corresponding subdirectory
> from the `dynamic` directory.
>
> This sample serves as an example of how to use the `debugfs::Scope`
> and `debugfs::ScopedDir` APIs to create and manage debugfs entries
> that are tied to the lifetime of a data structure.
>
> Signed-off-by: Matthew Maurer <mmaurer@xxxxxxxxxx>
> ---
> MAINTAINERS | 1 +
> samples/rust/Kconfig | 11 +++
> samples/rust/Makefile | 1 +
> samples/rust/rust_scoped_debugfs.rs | 134 ++++++++++++++++++++++++++++++++++++

Nit, should be called "rust_debugfs_scoped.rs" to make it more obvious
this is a debugfs thing (noun-verb).

thanks,

greg k-h