diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2006-10-02 05:18:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-02 10:57:20 -0400 |
commit | ab516013ad9ca47f1d3a936fa81303bfbf734d52 (patch) | |
tree | 643ea9c4c3d28958cb42dd87b1856f74edd22b11 /kernel/exit.c | |
parent | b1ba4ddde0cf67991d89f039365eaaeda61aa027 (diff) |
[PATCH] namespaces: add nsproxy
This patch adds a nsproxy structure to the task struct. Later patches will
move the fs namespace pointer into this structure, and introduce a new utsname
namespace into the nsproxy.
The vserver and openvz functionality, then, would be implemented in large part
by virtualizing/isolating more and more resources into namespaces, each
contained in the nsproxy.
[akpm@osdl.org: build fix]
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>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 3b47f26985f2..1d0e9ea1fa05 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/tsacct_kern.h> | 21 | #include <linux/tsacct_kern.h> |
22 | #include <linux/file.h> | 22 | #include <linux/file.h> |
23 | #include <linux/binfmts.h> | 23 | #include <linux/binfmts.h> |
24 | #include <linux/nsproxy.h> | ||
24 | #include <linux/ptrace.h> | 25 | #include <linux/ptrace.h> |
25 | #include <linux/profile.h> | 26 | #include <linux/profile.h> |
26 | #include <linux/mount.h> | 27 | #include <linux/mount.h> |
@@ -397,9 +398,14 @@ void daemonize(const char *name, ...) | |||
397 | fs = init_task.fs; | 398 | fs = init_task.fs; |
398 | current->fs = fs; | 399 | current->fs = fs; |
399 | atomic_inc(&fs->count); | 400 | atomic_inc(&fs->count); |
401 | |||
400 | exit_namespace(current); | 402 | exit_namespace(current); |
403 | exit_task_namespaces(current); | ||
401 | current->namespace = init_task.namespace; | 404 | current->namespace = init_task.namespace; |
405 | current->nsproxy = init_task.nsproxy; | ||
402 | get_namespace(current->namespace); | 406 | get_namespace(current->namespace); |
407 | get_task_namespaces(current); | ||
408 | |||
403 | exit_files(current); | 409 | exit_files(current); |
404 | current->files = init_task.files; | 410 | current->files = init_task.files; |
405 | atomic_inc(¤t->files->count); | 411 | atomic_inc(¤t->files->count); |
@@ -918,6 +924,7 @@ fastcall NORET_TYPE void do_exit(long code) | |||
918 | __exit_files(tsk); | 924 | __exit_files(tsk); |
919 | __exit_fs(tsk); | 925 | __exit_fs(tsk); |
920 | exit_namespace(tsk); | 926 | exit_namespace(tsk); |
927 | exit_task_namespaces(tsk); | ||
921 | exit_thread(); | 928 | exit_thread(); |
922 | cpuset_exit(tsk); | 929 | cpuset_exit(tsk); |
923 | exit_keys(tsk); | 930 | exit_keys(tsk); |