rust: file: optimize rust symbol generation for FileDescriptorReservation
Benno Lossin
Reviewed-byQuoted 15 lines · Kunwu Chan
From: Kunwu Chan <[email protected]>
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>::dropThese Rust symbols are trivial wrappers around the C functions
fd_install,put_unused_fdandput_task_struct. It doesn't make sense to go through a trivial wrapper for these functions, so mark them inline.
Quoted 5 lines
Suggested-by Alice Ryhl <[email protected]>Co-developed-by Grace Deng <[email protected]>Signed-off-by Grace Deng <[email protected]>Signed-off-by Kunwu Chan <[email protected]>
Reviewed-by Benno Lossin <[email protected]>
---
Cheers,
Benno
Quoted 8 lines
---
Changes in v2:
- Add link and Suggested-by
- Mark 'reserved_fd' as inline
- Reword commit msg--- rust/kernel/fs/file.rs | 4 ++++ 1 file changed, 4 insertions(+)