]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: iov: add iov_iter abstractions for ITER_SOURCE
authorAlice Ryhl <aliceryhl@google.com>
Fri, 22 Aug 2025 08:42:32 +0000 (08:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Sep 2025 11:27:20 +0000 (13:27 +0200)
commit06cb58b310ea38a8135827f726157df59a95376e
treec36b0634bb4cc8d5faa532c794a0b0977f440f7e
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585
rust: iov: add iov_iter abstractions for ITER_SOURCE

This adds abstractions for the iov_iter type in the case where
data_source is ITER_SOURCE. This will make Rust implementations of
fops->write_iter possible.

This series only has support for using existing IO vectors created by C
code. Additional abstractions will be needed to support the creation of
IO vectors in Rust code.

These abstractions make the assumption that `struct iov_iter` does not
have internal self-references, which implies that it is valid to move it
between different local variables.

Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
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-1-6ce4819c2977@google.com
rust/kernel/iov.rs [new file with mode: 0644]
rust/kernel/lib.rs