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

Alice Ryhl posted 27 patches 1 month ago
[PATCH v2 07/27] rust: cred: add __rust_helper to helpers
Posted by Alice Ryhl 1 month ago
This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge Hallyn <sergeh@kernel.org>
Cc: linux-security-module@vger.kernel.org
---
 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
Re: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
Posted by Paul Moore 1 month ago
On Mon, Jan 5, 2026 at 7:42 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Paul Moore <paul@paul-moore.com>
> Cc: Serge Hallyn <sergeh@kernel.org>
> Cc: linux-security-module@vger.kernel.org
> ---
>  rust/helpers/cred.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Paul Moore <paul@paul-moore.com>

-- 
paul-moore.com
Re: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
Posted by Paul Moore 1 month ago
On Tue, Jan 6, 2026 at 8:25 PM Paul Moore <paul@paul-moore.com> wrote:
>
> On Mon, Jan 5, 2026 at 7:42 AM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > This is needed to inline these helpers into Rust code.
> >
> > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > Reviewed-by: Gary Guo <gary@garyguo.net>
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> > ---
> > Cc: Paul Moore <paul@paul-moore.com>
> > Cc: Serge Hallyn <sergeh@kernel.org>
> > Cc: linux-security-module@vger.kernel.org
> > ---
> >  rust/helpers/cred.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Acked-by: Paul Moore <paul@paul-moore.com>

Ooops, sorry, I just saw that these were okay to merge into the
various subsystem trees.  Merged into lsm/dev, thanks.

-- 
paul-moore.com
Re: [PATCH v2 07/27] rust: cred: add __rust_helper to helpers
Posted by Alice Ryhl 1 month ago
On Wed, Jan 7, 2026 at 2:29 AM Paul Moore <paul@paul-moore.com> wrote:
>
> On Tue, Jan 6, 2026 at 8:25 PM Paul Moore <paul@paul-moore.com> wrote:
> >
> > On Mon, Jan 5, 2026 at 7:42 AM Alice Ryhl <aliceryhl@google.com> wrote:
> > >
> > > This is needed to inline these helpers into Rust code.
> > >
> > > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > > Reviewed-by: Gary Guo <gary@garyguo.net>
> > > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> > > ---
> > > Cc: Paul Moore <paul@paul-moore.com>
> > > Cc: Serge Hallyn <sergeh@kernel.org>
> > > Cc: linux-security-module@vger.kernel.org
> > > ---
> > >  rust/helpers/cred.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Acked-by: Paul Moore <paul@paul-moore.com>
>
> Ooops, sorry, I just saw that these were okay to merge into the
> various subsystem trees.  Merged into lsm/dev, thanks.

Thanks!