pid namespaces: add support for pid namespaces hierarchy
Changes
2 files changed · +4 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| include/linux/pid_namespace.h | modified | +2 | −0 | View file |
| kernel/pid.c | modified | +2 | −1 | View file |
include/linux/pid_namespace.h
View filediff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index aea13ec..14376eb 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -21,6 +21,8 @@ struct pid_namespace {
int last_pid;
struct task_struct *child_reaper;
struct kmem_cache *pid_cachep;
+ int level;
+ struct pid_namespace *parent;
};
extern struct pid_namespace init_pid_ns;
kernel/pid.c
View filediff --git a/kernel/pid.c b/kernel/pid.c
index bb07851..c7346fb 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -67,7 +67,8 @@ struct pid_namespace init_pid_ns = {
[ 0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL }
},
.last_pid = 0,
- .child_reaper = &init_task
+ .level = 0,
+ .child_reaper = &init_task,
};
int is_global_init(struct task_struct *tsk)