[PATCH] namespaces: incorporate fs namespace into nsproxy
This moves the mount namespace into the nsproxy. The mount namespace count now refers to the number of nsproxies point to it, rather than the number of tasks. As a result, the unshare_namespace() function in kernel/fork.c no longer checks whether it is being shared. Signed-off-by: Serge Hallyn <serue@us.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Andrey Savochkin <saw@sw.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
0437eb594e
commit
1651e14e28
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <linux/mount.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/nsproxy.h>
|
||||
|
||||
struct namespace {
|
||||
atomic_t count;
|
||||
@@ -26,11 +27,8 @@ static inline void put_namespace(struct namespace *namespace)
|
||||
|
||||
static inline void exit_namespace(struct task_struct *p)
|
||||
{
|
||||
struct namespace *namespace = p->namespace;
|
||||
struct namespace *namespace = p->nsproxy->namespace;
|
||||
if (namespace) {
|
||||
task_lock(p);
|
||||
p->namespace = NULL;
|
||||
task_unlock(p);
|
||||
put_namespace(namespace);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user