summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pid.h9
-rw-r--r--include/linux/pid_namespace.h14
-rw-r--r--include/linux/pidfs.h3
3 files changed, 16 insertions, 10 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 003a1027d219..ddaef0bbc8ba 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -6,6 +6,7 @@
#include <linux/rculist.h>
#include <linux/rcupdate.h>
#include <linux/refcount.h>
+#include <linux/rhashtable-types.h>
#include <linux/sched.h>
#include <linux/wait.h>
@@ -60,7 +61,7 @@ struct pid {
spinlock_t lock;
struct {
u64 ino;
- struct rb_node pidfs_node;
+ struct rhash_head pidfs_hash;
struct dentry *stashed;
struct pidfs_attr *attr;
};
@@ -73,7 +74,6 @@ struct pid {
struct upid numbers[];
};
-extern seqcount_spinlock_t pidmap_lock_seq;
extern struct pid init_struct_pid;
struct file;
@@ -310,6 +310,11 @@ static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_na
return pid;
}
+static inline pid_t task_ppid_vnr(const struct task_struct *tsk)
+{
+ return task_ppid_nr_ns(tsk, NULL);
+}
+
static inline pid_t task_ppid_nr(const struct task_struct *tsk)
{
return task_ppid_nr_ns(tsk, &init_pid_ns);
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 0e7ae12c96d2..b20baaa7e62b 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -27,6 +27,13 @@ struct pid_namespace {
struct idr idr;
struct rcu_head rcu;
unsigned int pid_allocated;
+#ifdef CONFIG_SYSCTL
+#if defined(CONFIG_MEMFD_CREATE)
+ int memfd_noexec_scope;
+#endif
+ struct ctl_table_set set;
+ struct ctl_table_header *sysctls;
+#endif
struct task_struct *child_reaper;
struct kmem_cache *pid_cachep;
unsigned int level;
@@ -40,13 +47,6 @@ struct pid_namespace {
int reboot; /* group exit code if this pidns was rebooted */
struct ns_common ns;
struct work_struct work;
-#ifdef CONFIG_SYSCTL
- struct ctl_table_set set;
- struct ctl_table_header *sysctls;
-#if defined(CONFIG_MEMFD_CREATE)
- int memfd_noexec_scope;
-#endif
-#endif
} __randomize_layout;
extern struct pid_namespace init_pid_ns;
diff --git a/include/linux/pidfs.h b/include/linux/pidfs.h
index 3e08c33da2df..416bdff4d6ce 100644
--- a/include/linux/pidfs.h
+++ b/include/linux/pidfs.h
@@ -6,7 +6,8 @@ struct coredump_params;
struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags);
void __init pidfs_init(void);
-void pidfs_add_pid(struct pid *pid);
+void pidfs_prepare_pid(struct pid *pid);
+int pidfs_add_pid(struct pid *pid);
void pidfs_remove_pid(struct pid *pid);
void pidfs_exit(struct task_struct *tsk);
#ifdef CONFIG_COREDUMP