]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lsm,rust: mark SecurityCtx methods inline
authorAlice Ryhl <aliceryhl@google.com>
Tue, 4 Mar 2025 10:26:52 +0000 (10:26 +0000)
committerPaul Moore <paul@paul-moore.com>
Tue, 4 Mar 2025 20:42:36 +0000 (15:42 -0500)
commit55e16418dd08fdccb7dc97fb8e975ded7c7ade9c
treef8786ac9fe55e51f4243dde69179f23493f9c4e6
parent9ec84f79c5a7a65cd69b5b705a203759665160cd
lsm,rust: mark SecurityCtx methods inline

When you build the kernel using the llvm-19.1.4-rust-1.83.0-x86_64
toolchain provided by kernel.org with ARCH=arm64, the following symbols
are generated:

$ nm vmlinux | grep ' _R'.*SecurityCtx | rustfilt
... T <kernel::security::SecurityCtx>::from_secid
... T <kernel::security::SecurityCtx as core::ops::drop::Drop>::drop

However, these Rust symbols are trivial wrappers around the functions
security_secid_to_secctx and security_release_secctx respectively. It
doesn't make sense to go through a trivial wrapper for these functions,
so mark them inline. Also mark other trivial methods inline to prevent
similar cases in the future.

After applying this patch, the above command will produce no output.

Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
[PM: trimmed long description lines, subj tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
rust/kernel/security.rs