<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/samples/rust/rust_debugfs_scoped.rs, branch v6.18.21</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-09-10T19:05:11+00:00</updated>
<entry>
<title>samples: rust: Add scoped debugfs sample driver</title>
<updated>2025-09-10T19:05:11+00:00</updated>
<author>
<name>Matthew Maurer</name>
<email>mmaurer@google.com</email>
</author>
<published>2025-09-04T21:13:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d4a5d397c7fb1ca967e0da202cac196e7324f4ea'/>
<id>urn:sha1:d4a5d397c7fb1ca967e0da202cac196e7324f4ea</id>
<content type='text'>
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 &lt;mmaurer@google.com&gt;
Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20250904-debugfs-rust-v11-7-7d12a165685a@google.com
[ Rename "scoped_debugfs" -&gt; "debugfs_scoped", fix up
  Result&lt;(), Error&gt; -&gt; Result. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
</feed>
