Re: [PATCH v2] rust: uaccess: mark UserSliceWriter method inline

From: Benno Lossin
Date: Sun Mar 16 2025 - 13:47:57 EST


On Thu Mar 13, 2025 at 3:57 AM CET, Antonio Hickey wrote:
> When you build the kernel using the llvm-19.1.4-rust-1.83.0-x86_64
> toolchain provided by kernel.org with ARCH=x86_64, the following symbol
> is generated:
>
> $nm vmlinux | grep ' _R' | rustfilt | rg UserSliceWriter
> ffffffff817c3390 T <kernel::uaccess::UserSliceWriter>::write_slice
>
> However, this Rust symbol is a trivial wrapper around the function
> copy_to_user. It doesn't make sense to go through a trivial wrapper
> for this function, so mark it inline.
>
> After applying this patch, the above command will produce no output.
>
> Suggested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1145
> Signed-off-by: Antonio Hickey <contact@xxxxxxxxxxxxxxxxx>

What about the other methods (like `write` and `read`?) in this file?

---
Cheers,
Benno