diff options
Diffstat (limited to 'include/linux/pid_namespace.h')
| -rw-r--r-- | include/linux/pid_namespace.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 65e3e87eacc5..215e5e3dda10 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
| @@ -21,6 +21,7 @@ struct pid_namespace { | |||
| 21 | struct kref kref; | 21 | struct kref kref; |
| 22 | struct pidmap pidmap[PIDMAP_ENTRIES]; | 22 | struct pidmap pidmap[PIDMAP_ENTRIES]; |
| 23 | int last_pid; | 23 | int last_pid; |
| 24 | unsigned int nr_hashed; | ||
| 24 | struct task_struct *child_reaper; | 25 | struct task_struct *child_reaper; |
| 25 | struct kmem_cache *pid_cachep; | 26 | struct kmem_cache *pid_cachep; |
| 26 | unsigned int level; | 27 | unsigned int level; |
| @@ -31,13 +32,18 @@ struct pid_namespace { | |||
| 31 | #ifdef CONFIG_BSD_PROCESS_ACCT | 32 | #ifdef CONFIG_BSD_PROCESS_ACCT |
| 32 | struct bsd_acct_struct *bacct; | 33 | struct bsd_acct_struct *bacct; |
| 33 | #endif | 34 | #endif |
| 35 | struct user_namespace *user_ns; | ||
| 36 | struct work_struct proc_work; | ||
| 34 | kgid_t pid_gid; | 37 | kgid_t pid_gid; |
| 35 | int hide_pid; | 38 | int hide_pid; |
| 36 | int reboot; /* group exit code if this pidns was rebooted */ | 39 | int reboot; /* group exit code if this pidns was rebooted */ |
| 40 | unsigned int proc_inum; | ||
| 37 | }; | 41 | }; |
| 38 | 42 | ||
| 39 | extern struct pid_namespace init_pid_ns; | 43 | extern struct pid_namespace init_pid_ns; |
| 40 | 44 | ||
| 45 | #define PIDNS_HASH_ADDING (1U << 31) | ||
| 46 | |||
| 41 | #ifdef CONFIG_PID_NS | 47 | #ifdef CONFIG_PID_NS |
| 42 | static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) | 48 | static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) |
| 43 | { | 49 | { |
| @@ -46,7 +52,8 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) | |||
| 46 | return ns; | 52 | return ns; |
| 47 | } | 53 | } |
| 48 | 54 | ||
| 49 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); | 55 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, |
| 56 | struct user_namespace *user_ns, struct pid_namespace *ns); | ||
| 50 | extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); | 57 | extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); |
| 51 | extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd); | 58 | extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd); |
| 52 | extern void put_pid_ns(struct pid_namespace *ns); | 59 | extern void put_pid_ns(struct pid_namespace *ns); |
| @@ -59,8 +66,8 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) | |||
| 59 | return ns; | 66 | return ns; |
| 60 | } | 67 | } |
| 61 | 68 | ||
| 62 | static inline struct pid_namespace * | 69 | static inline struct pid_namespace *copy_pid_ns(unsigned long flags, |
| 63 | copy_pid_ns(unsigned long flags, struct pid_namespace *ns) | 70 | struct user_namespace *user_ns, struct pid_namespace *ns) |
| 64 | { | 71 | { |
| 65 | if (flags & CLONE_NEWPID) | 72 | if (flags & CLONE_NEWPID) |
| 66 | ns = ERR_PTR(-EINVAL); | 73 | ns = ERR_PTR(-EINVAL); |
