Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: task: Add __rust_helper to helpers

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>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-21-51da5f454a67@google.com

authored by

Alice Ryhl and committed by
Boqun Feng
5f1193d5 d4ad4de9

+13 -13
+1 -1
rust/helpers/signal.c
··· 2 2 3 3 #include <linux/sched/signal.h> 4 4 5 - int rust_helper_signal_pending(struct task_struct *t) 5 + __rust_helper int rust_helper_signal_pending(struct task_struct *t) 6 6 { 7 7 return signal_pending(t); 8 8 }
+12 -12
rust/helpers/task.c
··· 3 3 #include <linux/kernel.h> 4 4 #include <linux/sched/task.h> 5 5 6 - void rust_helper_might_resched(void) 6 + __rust_helper void rust_helper_might_resched(void) 7 7 { 8 8 might_resched(); 9 9 } 10 10 11 - struct task_struct *rust_helper_get_current(void) 11 + __rust_helper struct task_struct *rust_helper_get_current(void) 12 12 { 13 13 return current; 14 14 } 15 15 16 - void rust_helper_get_task_struct(struct task_struct *t) 16 + __rust_helper void rust_helper_get_task_struct(struct task_struct *t) 17 17 { 18 18 get_task_struct(t); 19 19 } 20 20 21 - void rust_helper_put_task_struct(struct task_struct *t) 21 + __rust_helper void rust_helper_put_task_struct(struct task_struct *t) 22 22 { 23 23 put_task_struct(t); 24 24 } 25 25 26 - kuid_t rust_helper_task_uid(struct task_struct *task) 26 + __rust_helper kuid_t rust_helper_task_uid(struct task_struct *task) 27 27 { 28 28 return task_uid(task); 29 29 } 30 30 31 - kuid_t rust_helper_task_euid(struct task_struct *task) 31 + __rust_helper kuid_t rust_helper_task_euid(struct task_struct *task) 32 32 { 33 33 return task_euid(task); 34 34 } 35 35 36 36 #ifndef CONFIG_USER_NS 37 - uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) 37 + __rust_helper uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) 38 38 { 39 39 return from_kuid(to, uid); 40 40 } 41 41 #endif /* CONFIG_USER_NS */ 42 42 43 - bool rust_helper_uid_eq(kuid_t left, kuid_t right) 43 + __rust_helper bool rust_helper_uid_eq(kuid_t left, kuid_t right) 44 44 { 45 45 return uid_eq(left, right); 46 46 } 47 47 48 - kuid_t rust_helper_current_euid(void) 48 + __rust_helper kuid_t rust_helper_current_euid(void) 49 49 { 50 50 return current_euid(); 51 51 } 52 52 53 - struct user_namespace *rust_helper_current_user_ns(void) 53 + __rust_helper struct user_namespace *rust_helper_current_user_ns(void) 54 54 { 55 55 return current_user_ns(); 56 56 } 57 57 58 - pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, 59 - struct pid_namespace *ns) 58 + __rust_helper pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, 59 + struct pid_namespace *ns) 60 60 { 61 61 return task_tgid_nr_ns(tsk, ns); 62 62 }