From a71204ec911d0c0e9be20e8e7cadda54e4464e8b Mon Sep 17 00:00:00 2001 From: Nakamura Shuta Date: Fri, 29 May 2026 17:53:16 +0900 Subject: rust: page: mark Page::nid as inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building the kernel, the following Rust symbol is generated: $ nm vmlinux | grep ' _R'.*Page | rustfilt ::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`. Link: https://github.com/Rust-for-Linux/linux/issues/1145 Link: https://lore.kernel.org/20260529085316.27432-1-nakamura.shuta@gmail.com Signed-off-by: Nakamura Shuta Reviewed-by: Alice Ryhl Reviewed-by: Gary Guo Cc: Andreas Hindborg Cc: Björn Roy Baron Cc: Danilo Krummrich Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Miguel Ojeda Cc: Trevor Gross Signed-off-by: Andrew Morton --- rust/kernel/page.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'rust/kernel') diff --git a/rust/kernel/page.rs b/rust/kernel/page.rs index adecb200c654..764bb5acc90a 100644 --- a/rust/kernel/page.rs +++ b/rust/kernel/page.rs @@ -193,6 +193,7 @@ impl 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()) } -- cgit v1.2.3