summaryrefslogtreecommitdiffstats
path: root/rust/helpers/task.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-09-20 08:15:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-09-20 08:15:23 -0700
commitbdab18633a302c82b5e5d5dbc4e38b0baf9c0837 (patch)
tree0446500af9a76d4e8b2a72a0a41391ceede73a10 /rust/helpers/task.c
downloadlinux-stable-bdab18633a302c82b5e5d5dbc4e38b0baf9c0837.tar.gz
linux-stable-bdab18633a302c82b5e5d5dbc4e38b0baf9c0837.zip
Merge tag 'locking-urgent-2026-09-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tipgrafted
Pull futex fix from Ingo Molnar: - Also allocate a default private futex hash on vfork() as well, to avoid races with (private) futex waiters (Peter Zijlstra) * tag 'locking-urgent-2026-09-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: Also allocate private hash on vfork()
Diffstat (limited to 'rust/helpers/task.c')
-rw-r--r--rust/helpers/task.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/rust/helpers/task.c b/rust/helpers/task.c
new file mode 100644
index 000000000..b46b1433a
--- /dev/null
+++ b/rust/helpers/task.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/kernel.h>
+#include <linux/sched/task.h>
+
+__rust_helper void rust_helper_might_resched(void)
+{
+ might_resched();
+}
+
+__rust_helper struct task_struct *rust_helper_get_current(void)
+{
+ return current;
+}
+
+__rust_helper void rust_helper_get_task_struct(struct task_struct *t)
+{
+ get_task_struct(t);
+}
+
+__rust_helper void rust_helper_put_task_struct(struct task_struct *t)
+{
+ put_task_struct(t);
+}
+
+__rust_helper kuid_t rust_helper_task_uid(struct task_struct *task)
+{
+ return task_uid(task);
+}
+
+#ifndef CONFIG_USER_NS
+__rust_helper uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid)
+{
+ return from_kuid(to, uid);
+}
+#endif /* CONFIG_USER_NS */
+
+__rust_helper bool rust_helper_uid_eq(kuid_t left, kuid_t right)
+{
+ return uid_eq(left, right);
+}
+
+__rust_helper kuid_t rust_helper_current_euid(void)
+{
+ return current_euid();
+}
+
+__rust_helper struct user_namespace *rust_helper_current_user_ns(void)
+{
+ return current_user_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);
+}