[PATCH v2 07/27] rust: cred: add __rust_helper to helpers

From: Alice Ryhl

Date: Mon Jan 05 2026 - 07:51:55 EST


This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@xxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
---
Cc: Paul Moore <paul@xxxxxxxxxxxxxx>
Cc: Serge Hallyn <sergeh@xxxxxxxxxx>
Cc: linux-security-module@xxxxxxxxxxxxxxx
---
rust/helpers/cred.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust/helpers/cred.c b/rust/helpers/cred.c
index fde7ae20cdd19f04ac5f28808586c65de6b72f09..a56a7b7536232733dcdc640f09f8f2537e69d75e 100644
--- a/rust/helpers/cred.c
+++ b/rust/helpers/cred.c
@@ -2,12 +2,12 @@

#include <linux/cred.h>

-const struct cred *rust_helper_get_cred(const struct cred *cred)
+__rust_helper const struct cred *rust_helper_get_cred(const struct cred *cred)
{
return get_cred(cred);
}

-void rust_helper_put_cred(const struct cred *cred)
+__rust_helper void rust_helper_put_cred(const struct cred *cred)
{
put_cred(cred);
}

--
2.52.0.351.gbe84eed79e-goog