diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/init_task.h | 2 | ||||
-rw-r--r-- | include/linux/mnt_namespace.h | 42 | ||||
-rw-r--r-- | include/linux/mount.h | 4 | ||||
-rw-r--r-- | include/linux/namespace.h | 42 | ||||
-rw-r--r-- | include/linux/nsproxy.h | 4 |
5 files changed, 47 insertions, 47 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 848a68af3d42..5c4989172f7e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -76,7 +76,7 @@ extern struct nsproxy init_nsproxy; | |||
76 | .count = ATOMIC_INIT(1), \ | 76 | .count = ATOMIC_INIT(1), \ |
77 | .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ | 77 | .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ |
78 | .uts_ns = &init_uts_ns, \ | 78 | .uts_ns = &init_uts_ns, \ |
79 | .namespace = NULL, \ | 79 | .mnt_ns = NULL, \ |
80 | INIT_IPC_NS(ipc_ns) \ | 80 | INIT_IPC_NS(ipc_ns) \ |
81 | } | 81 | } |
82 | 82 | ||
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h new file mode 100644 index 000000000000..4af0b1fc282a --- /dev/null +++ b/include/linux/mnt_namespace.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef _NAMESPACE_H_ | ||
2 | #define _NAMESPACE_H_ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/mount.h> | ||
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | |||
9 | struct mnt_namespace { | ||
10 | atomic_t count; | ||
11 | struct vfsmount * root; | ||
12 | struct list_head list; | ||
13 | wait_queue_head_t poll; | ||
14 | int event; | ||
15 | }; | ||
16 | |||
17 | extern int copy_mnt_ns(int, struct task_struct *); | ||
18 | extern void __put_mnt_ns(struct mnt_namespace *ns); | ||
19 | extern struct mnt_namespace *dup_mnt_ns(struct task_struct *, | ||
20 | struct fs_struct *); | ||
21 | |||
22 | static inline void put_mnt_ns(struct mnt_namespace *ns) | ||
23 | { | ||
24 | if (atomic_dec_and_lock(&ns->count, &vfsmount_lock)) | ||
25 | /* releases vfsmount_lock */ | ||
26 | __put_mnt_ns(ns); | ||
27 | } | ||
28 | |||
29 | static inline void exit_mnt_ns(struct task_struct *p) | ||
30 | { | ||
31 | struct mnt_namespace *ns = p->nsproxy->mnt_ns; | ||
32 | if (ns) | ||
33 | put_mnt_ns(ns); | ||
34 | } | ||
35 | |||
36 | static inline void get_mnt_ns(struct mnt_namespace *ns) | ||
37 | { | ||
38 | atomic_inc(&ns->count); | ||
39 | } | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
diff --git a/include/linux/mount.h b/include/linux/mount.h index 403d1a97c512..e357dc86a4de 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -20,7 +20,7 @@ | |||
20 | struct super_block; | 20 | struct super_block; |
21 | struct vfsmount; | 21 | struct vfsmount; |
22 | struct dentry; | 22 | struct dentry; |
23 | struct namespace; | 23 | struct mnt_namespace; |
24 | 24 | ||
25 | #define MNT_NOSUID 0x01 | 25 | #define MNT_NOSUID 0x01 |
26 | #define MNT_NODEV 0x02 | 26 | #define MNT_NODEV 0x02 |
@@ -52,7 +52,7 @@ struct vfsmount { | |||
52 | struct list_head mnt_slave_list;/* list of slave mounts */ | 52 | struct list_head mnt_slave_list;/* list of slave mounts */ |
53 | struct list_head mnt_slave; /* slave list entry */ | 53 | struct list_head mnt_slave; /* slave list entry */ |
54 | struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ | 54 | struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ |
55 | struct namespace *mnt_namespace; /* containing namespace */ | 55 | struct mnt_namespace *mnt_ns; /* containing namespace */ |
56 | int mnt_pinned; | 56 | int mnt_pinned; |
57 | }; | 57 | }; |
58 | 58 | ||
diff --git a/include/linux/namespace.h b/include/linux/namespace.h deleted file mode 100644 index d137009f0b2b..000000000000 --- a/include/linux/namespace.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #ifndef _NAMESPACE_H_ | ||
2 | #define _NAMESPACE_H_ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/mount.h> | ||
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | |||
9 | struct namespace { | ||
10 | atomic_t count; | ||
11 | struct vfsmount * root; | ||
12 | struct list_head list; | ||
13 | wait_queue_head_t poll; | ||
14 | int event; | ||
15 | }; | ||
16 | |||
17 | extern int copy_namespace(int, struct task_struct *); | ||
18 | extern void __put_namespace(struct namespace *namespace); | ||
19 | extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *); | ||
20 | |||
21 | static inline void put_namespace(struct namespace *namespace) | ||
22 | { | ||
23 | if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock)) | ||
24 | /* releases vfsmount_lock */ | ||
25 | __put_namespace(namespace); | ||
26 | } | ||
27 | |||
28 | static inline void exit_namespace(struct task_struct *p) | ||
29 | { | ||
30 | struct namespace *namespace = p->nsproxy->namespace; | ||
31 | if (namespace) { | ||
32 | put_namespace(namespace); | ||
33 | } | ||
34 | } | ||
35 | |||
36 | static inline void get_namespace(struct namespace *namespace) | ||
37 | { | ||
38 | atomic_inc(&namespace->count); | ||
39 | } | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 971d1c6dfc4b..0aba1b1a39c7 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -4,7 +4,7 @@ | |||
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 | 10 | ||
@@ -25,7 +25,7 @@ struct nsproxy { | |||
25 | spinlock_t nslock; | 25 | spinlock_t nslock; |
26 | struct uts_namespace *uts_ns; | 26 | struct uts_namespace *uts_ns; |
27 | struct ipc_namespace *ipc_ns; | 27 | struct ipc_namespace *ipc_ns; |
28 | struct namespace *namespace; | 28 | struct mnt_namespace *mnt_ns; |
29 | }; | 29 | }; |
30 | extern struct nsproxy init_nsproxy; | 30 | extern struct nsproxy init_nsproxy; |
31 | 31 | ||