mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Alice Ryhl <aliceryhl@google.com>,
	 Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>,
	 FUJITA Tomonori <fujita.tomonori@gmail.com>
Subject: [PATCH v2 21/27] rust: task: add __rust_helper to helpers
Date: Mon, 05 Jan 2026 12:42:34 +0000	[thread overview]
Message-ID: <20260105-define-rust-helper-v2-21-51da5f454a67@google.com> (raw)
In-Reply-To: <20260105-define-rust-helper-v2-0-51da5f454a67@google.com>

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: Boqun Feng <boqun.feng@gmail.com>
Cc: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
 rust/helpers/signal.c |  2 +-
 rust/helpers/task.c   | 24 ++++++++++++------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c
index 1a6bbe9438e281cd8b61141a390cea042949e7bd..85111186cf3d77508fefac9407c87c5f000d15cf 100644
--- a/rust/helpers/signal.c
+++ b/rust/helpers/signal.c
@@ -2,7 +2,7 @@
 
 #include <linux/sched/signal.h>
 
-int rust_helper_signal_pending(struct task_struct *t)
+__rust_helper int rust_helper_signal_pending(struct task_struct *t)
 {
 	return signal_pending(t);
 }
diff --git a/rust/helpers/task.c b/rust/helpers/task.c
index 2c85bbc2727efedf5eb61fe496cd80598fafcdd1..c0e1a06ede78c0b0641707b52a82725543e2c02c 100644
--- a/rust/helpers/task.c
+++ b/rust/helpers/task.c
@@ -3,60 +3,60 @@
 #include <linux/kernel.h>
 #include <linux/sched/task.h>
 
-void rust_helper_might_resched(void)
+__rust_helper void rust_helper_might_resched(void)
 {
 	might_resched();
 }
 
-struct task_struct *rust_helper_get_current(void)
+__rust_helper struct task_struct *rust_helper_get_current(void)
 {
 	return current;
 }
 
-void rust_helper_get_task_struct(struct task_struct *t)
+__rust_helper void rust_helper_get_task_struct(struct task_struct *t)
 {
 	get_task_struct(t);
 }
 
-void rust_helper_put_task_struct(struct task_struct *t)
+__rust_helper void rust_helper_put_task_struct(struct task_struct *t)
 {
 	put_task_struct(t);
 }
 
-kuid_t rust_helper_task_uid(struct task_struct *task)
+__rust_helper kuid_t rust_helper_task_uid(struct task_struct *task)
 {
 	return task_uid(task);
 }
 
-kuid_t rust_helper_task_euid(struct task_struct *task)
+__rust_helper kuid_t rust_helper_task_euid(struct task_struct *task)
 {
 	return task_euid(task);
 }
 
 #ifndef CONFIG_USER_NS
-uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid)
+__rust_helper uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid)
 {
 	return from_kuid(to, uid);
 }
 #endif /* CONFIG_USER_NS */
 
-bool rust_helper_uid_eq(kuid_t left, kuid_t right)
+__rust_helper bool rust_helper_uid_eq(kuid_t left, kuid_t right)
 {
 	return uid_eq(left, right);
 }
 
-kuid_t rust_helper_current_euid(void)
+__rust_helper kuid_t rust_helper_current_euid(void)
 {
 	return current_euid();
 }
 
-struct user_namespace *rust_helper_current_user_ns(void)
+__rust_helper struct user_namespace *rust_helper_current_user_ns(void)
 {
 	return current_user_ns();
 }
 
-pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk,
-				  struct pid_namespace *ns)
+__rust_helper pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk,
+						struct pid_namespace *ns)
 {
 	return task_tgid_nr_ns(tsk, ns);
 }

-- 
2.52.0.351.gbe84eed79e-goog


  parent reply	other threads:[~2026-01-05 12:43 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 12:42 [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 01/27] rust: barrier: add __rust_helper to helpers Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: barrier: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 02/27] rust: blk: add " Alice Ryhl
2026-01-07 10:53   ` Andreas Hindborg
2026-01-13 10:49   ` [tip: locking/core] rust: blk: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 03/27] rust: bug: add " Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 04/27] rust: clk: " Alice Ryhl
2026-02-07  2:14   ` Stephen Boyd
2026-01-05 12:42 ` [PATCH v2 05/27] rust: completion: " Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: completion: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 06/27] rust: cpu: add " Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: cpu: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 07/27] rust: cred: add " Alice Ryhl
2026-01-07  1:25   ` Paul Moore
2026-01-07  1:29     ` Paul Moore
2026-01-07  6:53       ` Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 08/27] rust: err: " Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 09/27] rust: jump_label: " Alice Ryhl
2026-02-10 17:54   ` Miguel Ojeda
2026-02-10 20:26     ` Peter Zijlstra
2026-02-10 23:11       ` Miguel Ojeda
2026-01-05 12:42 ` [PATCH v2 10/27] rust: maple_tree: " Alice Ryhl
2026-01-05 15:09   ` Liam R. Howlett
2026-01-05 12:42 ` [PATCH v2 11/27] rust: mm: " Alice Ryhl
2026-01-05 15:10   ` Liam R. Howlett
2026-01-05 15:22     ` Lorenzo Stoakes
2026-01-05 12:42 ` [PATCH v2 12/27] rust: of: " Alice Ryhl
2026-01-12 16:26   ` Rob Herring
2026-01-05 12:42 ` [PATCH v2 13/27] rust: processor: " Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: processor: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 14/27] rust: pwm: add " Alice Ryhl
2026-01-05 17:09   ` Michal Wilczynski
2026-01-20 18:02   ` Uwe Kleine-König
2026-01-05 12:42 ` [PATCH v2 15/27] rust: rbtree: " Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 16/27] rust: rcu: " Alice Ryhl
2026-01-05 15:26   ` Joel Fernandes
2026-01-13 10:49   ` [tip: locking/core] rust: rcu: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 17/27] rust: refcount: add " Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: refcount: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 18/27] rust: security: add " Alice Ryhl
2026-01-07  1:29   ` Paul Moore
2026-01-05 12:42 ` [PATCH v2 19/27] rust: slab: " Alice Ryhl
2026-01-05 12:56   ` Danilo Krummrich
2026-01-05 13:06     ` Alice Ryhl
2026-01-05 17:04       ` Miguel Ojeda
2026-01-05 12:42 ` [PATCH v2 20/27] rust: sync: " Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: sync: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` Alice Ryhl [this message]
2026-01-13 10:49   ` [tip: locking/core] rust: task: " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 22/27] rust: time: add " Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: time: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 23/27] rust: uaccess: add " Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 24/27] rust: usb: " Alice Ryhl
2026-01-05 13:40   ` Daniel Almeida
2026-01-05 12:42 ` [PATCH v2 25/27] rust: wait: " Alice Ryhl
2026-01-13 10:49   ` [tip: locking/core] rust: wait: Add " tip-bot2 for Alice Ryhl
2026-01-05 12:42 ` [PATCH v2 26/27] rust: workqueue: add " Alice Ryhl
2026-01-12 18:06   ` Tejun Heo
2026-01-05 12:42 ` [PATCH v2 27/27] rust: xarray: " Alice Ryhl
2026-01-05 15:26   ` Tamir Duberstein
2026-01-15  9:02   ` Andreas Hindborg
2026-01-05 15:41 ` [PATCH v2 00/27] Allow inlining C helpers into Rust when using LTO Boqun Feng
2026-01-26  5:08 ` Miguel Ojeda
2026-03-10 10:56 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260105-define-rust-helper-v2-21-51da5f454a67@google.com \
    --to=aliceryhl@google.com \
    --cc=boqun.feng@gmail.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®