aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKirill Korotaev <dev@sw.ru>2006-12-08 05:37:56 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:51 -0500
commit6b3286ed1169d74fea401367d6d4d6c6ec758a81 (patch)
treefaf5beddb797875bb92855f8606735478267959a /include
parent1ec320afdc9552c92191d5f89fcd1ebe588334ca (diff)
[PATCH] rename struct namespace to struct mnt_namespace
Rename 'struct namespace' to 'struct mnt_namespace' to avoid confusion with other namespaces being developped for the containers : pid, uts, ipc, etc. 'namespace' variables and attributes are also renamed to 'mnt_ns' Signed-off-by: Kirill Korotaev <dev@sw.ru> Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/mnt_namespace.h42
-rw-r--r--include/linux/mount.h4
-rw-r--r--include/linux/namespace.h42
-rw-r--r--include/linux/nsproxy.h4
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
9struct 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
17extern int copy_mnt_ns(int, struct task_struct *);
18extern void __put_mnt_ns(struct mnt_namespace *ns);
19extern struct mnt_namespace *dup_mnt_ns(struct task_struct *,
20 struct fs_struct *);
21
22static 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
29static 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
36static 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 @@
20struct super_block; 20struct super_block;
21struct vfsmount; 21struct vfsmount;
22struct dentry; 22struct dentry;
23struct namespace; 23struct 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
9struct 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
17extern int copy_namespace(int, struct task_struct *);
18extern void __put_namespace(struct namespace *namespace);
19extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *);
20
21static 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
28static 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
36static 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
7struct namespace; 7struct mnt_namespace;
8struct uts_namespace; 8struct uts_namespace;
9struct ipc_namespace; 9struct 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};
30extern struct nsproxy init_nsproxy; 30extern struct nsproxy init_nsproxy;
31 31