aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nsproxy.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/nsproxy.h')
-rw-r--r--include/linux/nsproxy.h11
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
7struct namespace; 7struct mnt_namespace;
8struct uts_namespace; 8struct uts_namespace;
9struct ipc_namespace; 9struct ipc_namespace;
10struct 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;
23struct nsproxy { 24struct 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};
30extern struct nsproxy init_nsproxy; 33extern 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