]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
samples: rust_misc_device: Expand the sample to support read()ing from userspace
authorLee Jones <lee@kernel.org>
Fri, 22 Aug 2025 08:42:36 +0000 (08:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Sep 2025 11:27:20 +0000 (13:27 +0200)
commite5b0d7da941a7dc1ced09d57b967fdc124f510f8
tree04b858442f0706868dfe6f6881230892de07d317
parent39c2745b37dac18c6604083f26caea3fd7e4c50b
samples: rust_misc_device: Expand the sample to support read()ing from userspace

A userland application can now operate on the char device with read() in
order to consume a locally held buffer.  Memory for the buffer is to be
provisioned and the buffer populated in its subsequently provided
write() counterpart.

Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Co-developed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250822-iov-iter-v5-5-6ce4819c2977@google.com
samples/rust/rust_misc_device.rs