<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/rust/kernel/debugfs/entry.rs, branch v6.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-10-22T05:47:27Z</updated>
<entry>
<title>rust: replace `CStr` with `core::ffi::CStr`</title>
<updated>2025-10-22T05:47:27Z</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2025-10-18T19:16:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3b83f5d5e78ac5cddd811a5e431af73959864390'/>
<id>urn:sha1:3b83f5d5e78ac5cddd811a5e431af73959864390</id>
<content type='text'>
`kernel::ffi::CStr` was introduced in commit d126d2380131 ("rust: str:
add `CStr` type") in November 2022 as an upstreaming of earlier work
that was done in May 2021[0]. That earlier work, having predated the
inclusion of `CStr` in `core`, largely duplicated the implementation of
`std::ffi::CStr`.

`std::ffi::CStr` was moved to `core::ffi::CStr` in Rust 1.64 in
September 2022. Hence replace `kernel::str::CStr` with `core::ffi::CStr`
to reduce our custom code footprint, and retain needed custom
functionality through an extension trait.

Add `CStr` to `ffi` and the kernel prelude.

Link: https://github.com/Rust-for-Linux/linux/commit/faa3cbcca03d0dec8f8e43f1d8d5c0860d98a23f [0]
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Link: https://patch.msgid.link/20251018-cstr-core-v18-16-9378a54385f8@gmail.com
[ Removed assert that would now depend on the Rust version. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: debugfs: Add support for scoped directories</title>
<updated>2025-09-10T16:58:29Z</updated>
<author>
<name>Matthew Maurer</name>
<email>mmaurer@google.com</email>
</author>
<published>2025-09-04T21:13:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f0942581dd0218c4449dac0639cf362e943c302'/>
<id>urn:sha1:5f0942581dd0218c4449dac0639cf362e943c302</id>
<content type='text'>
Introduces the concept of a `ScopedDir`, which allows for the creation
of debugfs directories and files that are tied to the lifetime of a
particular data structure. This ensures that debugfs entries do not
outlive the data they refer to.

The new `Dir::scope` method creates a new directory that is owned by a
`Scope` handle. All files and subdirectories created within this scope
are automatically cleaned up when the `Scope` is dropped.

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-6-7d12a165685a@google.com
[ Fix up Result&lt;(), Error&gt; -&gt; Result; fix spurious backtick in
  doc-comment. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: debugfs: Add support for read-only files</title>
<updated>2025-09-10T16:58:11Z</updated>
<author>
<name>Matthew Maurer</name>
<email>mmaurer@google.com</email>
</author>
<published>2025-09-04T21:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5e40b591cb46c0379d5406fa5548c9b2a3801353'/>
<id>urn:sha1:5e40b591cb46c0379d5406fa5548c9b2a3801353</id>
<content type='text'>
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: 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-2-7d12a165685a@google.com
[ Fixup build failure when CONFIG_DEBUGFS=n. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: debugfs: Add initial support for directories</title>
<updated>2025-09-10T16:57:43Z</updated>
<author>
<name>Matthew Maurer</name>
<email>mmaurer@google.com</email>
</author>
<published>2025-09-04T21:13:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f201ca18c825592e392596a2fca2374dd2a4dfe'/>
<id>urn:sha1:7f201ca18c825592e392596a2fca2374dd2a4dfe</id>
<content type='text'>
Adds a `debugfs::Dir` type that can be used to create and remove
DebugFS directories. The `Dir` handle automatically cleans up the
directory on `Drop`.

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-1-7d12a165685a@google.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
</feed>
