drm/modes: Fix drm_mode_vrefres() docs
[drm/drm-misc.git] / rust / helpers / pid_namespace.c
blobf41482bdec9a7c4e84b81ec141027fbd65251230
1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/pid_namespace.h>
4 #include <linux/cleanup.h>
6 struct pid_namespace *rust_helper_get_pid_ns(struct pid_namespace *ns)
8 return get_pid_ns(ns);
11 void rust_helper_put_pid_ns(struct pid_namespace *ns)
13 put_pid_ns(ns);
16 /* Get a reference on a task's pid namespace. */
17 struct pid_namespace *rust_helper_task_get_pid_ns(struct task_struct *task)
19 struct pid_namespace *pid_ns;
21 guard(rcu)();
22 pid_ns = task_active_pid_ns(task);
23 if (pid_ns)
24 get_pid_ns(pid_ns);
25 return pid_ns;