diff options
Diffstat (limited to 'include/linux/nsproxy.h')
-rw-r--r-- | include/linux/nsproxy.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index f6baecdeecd6..fdfb0e44912f 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -4,9 +4,10 @@ | |||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | 6 | ||
7 | struct namespace; | 7 | struct mnt_namespace; |
8 | struct uts_namespace; | 8 | struct uts_namespace; |
9 | struct ipc_namespace; | 9 | struct ipc_namespace; |
10 | struct pid_namespace; | ||
10 | 11 | ||
11 | /* | 12 | /* |
12 | * A structure to contain pointers to all per-process | 13 | * A structure to contain pointers to all per-process |
@@ -23,9 +24,11 @@ struct ipc_namespace; | |||
23 | struct nsproxy { | 24 | struct nsproxy { |
24 | atomic_t count; | 25 | atomic_t count; |
25 | spinlock_t nslock; | 26 | spinlock_t nslock; |
27 | unsigned long id; | ||
26 | struct uts_namespace *uts_ns; | 28 | struct uts_namespace *uts_ns; |
27 | struct ipc_namespace *ipc_ns; | 29 | struct ipc_namespace *ipc_ns; |
28 | struct namespace *namespace; | 30 | struct mnt_namespace *mnt_ns; |
31 | struct pid_namespace *pid_ns; | ||
29 | }; | 32 | }; |
30 | extern struct nsproxy init_nsproxy; | 33 | extern struct nsproxy init_nsproxy; |
31 | 34 | ||
@@ -45,8 +48,10 @@ static inline void exit_task_namespaces(struct task_struct *p) | |||
45 | { | 48 | { |
46 | struct nsproxy *ns = p->nsproxy; | 49 | struct nsproxy *ns = p->nsproxy; |
47 | if (ns) { | 50 | if (ns) { |
48 | put_nsproxy(ns); | 51 | task_lock(p); |
49 | p->nsproxy = NULL; | 52 | p->nsproxy = NULL; |
53 | task_unlock(p); | ||
54 | put_nsproxy(ns); | ||
50 | } | 55 | } |
51 | } | 56 | } |
52 | #endif | 57 | #endif |