Re: [PATCH v2] rust: file: optimize rust symbol generation for FileDescriptorReservation
From: Christian Brauner
Date: Tue Mar 18 2025 - 04:24:50 EST
On Mon, Mar 17, 2025 at 10:24:15AM +0000, Alice Ryhl wrote:
> Adding Christian Brauner who originally merged the
> rust/kernel/fs/file.rs file.
>
> On Mon, Mar 17, 2025 at 10:37:02AM +0800, Kunwu Chan wrote:
> > From: Kunwu Chan <kunwu.chan@xxxxxxxxxxx>
> >
> > When build the kernel using the llvm-18.1.3-rust-1.85.0-x86_64
> > with ARCH=arm64, the following symbols are generated:
> >
> > $ nm vmlinux | grep ' _R'.*FileDescriptorReservation | rustfilt
> > ... T <kernel::fs::file::FileDescriptorReservation>::fd_install
> > ... T <kernel::fs::file::FileDescriptorReservation>::get_unused_fd_flags
> > ... T <kernel::fs::file::FileDescriptorReservation as core::ops::drop::Drop>::drop
> >
> > These Rust symbols are trivial wrappers around the C functions
> > fd_install, put_unused_fd and put_task_struct. It
> > doesn't make sense to go through a trivial wrapper for these
> > functions, so mark them inline.
> >
> > Link: https://github.com/Rust-for-Linux/linux/issues/1145
> > Suggested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> > Co-developed-by: Grace Deng <Grace.Deng006@xxxxxxxxx>
> > Signed-off-by: Grace Deng <Grace.Deng006@xxxxxxxxx>
> > Signed-off-by: Kunwu Chan <kunwu.chan@xxxxxxxxxxx>
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
I mentioned various times that anything fs related goes through the VFS
tree, I hope that we're all still aware of this agreement.