aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pid.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pid.h')
-rw-r--r--include/linux/pid.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 3c8ef5a199ca..9645b1194c98 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -3,6 +3,8 @@
#define _LINUX_PID_H
#include <linux/rculist.h>
+#include <linux/wait.h>
+#include <linux/refcount.h>
enum pid_type
{
@@ -56,10 +58,12 @@ struct upid {
struct pid
{
- atomic_t count;
+ refcount_t count;
unsigned int level;
/* lists of tasks that use this pid */
struct hlist_head tasks[PIDTYPE_MAX];
+ /* wait queue for pidfd notifications */
+ wait_queue_head_t wait_pidfd;
struct rcu_head rcu;
struct upid numbers[1];
};
@@ -68,10 +72,14 @@ extern struct pid init_struct_pid;
extern const struct file_operations pidfd_fops;
+struct file;
+
+extern struct pid *pidfd_pid(const struct file *file);
+
static inline struct pid *get_pid(struct pid *pid)
{
if (pid)
- atomic_inc(&pid->count);
+ refcount_inc(&pid->count);
return pid;
}