rust: page: mark Page::nid as inline
Subsystems (3)
PATCH 1/1 rust: page: mark Page::nid as inline
When building the kernel, the following Rust symbol is generated:
$ nm vmlinux | grep ' _R'.*Page | rustfilt <kernel::page::Page>::nid
Page::nid is a trivial wrapper around the C function page_to_nid. It does not make sense to go through a trivial wrapper for this function, so mark it inline.
This follows commit 878620c5a93a ("rust: page: optimize rust symbol generation for Page"), which did the same for alloc_page and drop.
--- rust/kernel/page.rs | 1 + 1 file changed, 1 insertion(+)
rust/kernel/page.rs +1 -0
@@ -193,6 +193,7 @@ pub fn as_ptr(&self) -> *mut bindings::page { }/// Get the node id containing this page. +#[inline] pub fn nid (&self) ->i32 {// SAFETY: Always safe to call with a valid page. unsafe { bindings::page_to_nid (self.as_ptr ()) }
base-commit: 72d33b8bfeacbfdccf2cda4650e8e002def036f8
Signature · 1 line
2.51.0
Quoted 10 lines · Nakamura Shuta
When building the kernel, the following Rust symbol is generated:
$ nm vmlinux | grep ' _R'.*Page | rustfilt <kernel::page::Page>::nid
Page::nidis a trivial wrapper around the C functionpage_to_nid. It does not make sense to go through a trivial wrapper for this function, so mark it inline.
Quoted 5 lines
This follows commit
878620c5a93a("rust: page: optimize rust symbol generation for Page"), which did the same foralloc_pageanddrop.
Andrew, can you pick this? Thanks!
Quoted 9 lines · Nakamura Shuta
When building the kernel, the following Rust symbol is generated:
$ nm vmlinux | grep ' _R'.*Page | rustfilt <kernel::page::Page>::nid
Page::nidis a trivial wrapper around the C functionpage_to_nid. It does not make sense to go through a trivial wrapper for this function, so mark it inline.
Quoted 5 lines
This follows commit
878620c5a93a("rust: page: optimize rust symbol generation for Page"), which did the same foralloc_pageanddrop.
Quoted 3 lines
--- rust/kernel/page.rs | 1 + 1 file changed, 1 insertion(+)