From 4865ecf1315b450ab3317a745a6678c04d311e40 Mon Sep 17 00:00:00 2001 From: "Serge E. Hallyn" Date: Mon, 2 Oct 2006 02:18:14 -0700 Subject: [PATCH] namespaces: utsname: implement utsname namespaces This patch defines the uts namespace and some manipulators. Adds the uts namespace to task_struct, and initializes a system-wide init namespace. It leaves a #define for system_utsname so sysctl will compile. This define will be removed in a separate patch. [akpm@osdl.org: build fix, cleanup] Signed-off-by: Serge Hallyn Cc: Kirill Korotaev Cc: "Eric W. Biederman" Cc: Herbert Poetzl Cc: Andrey Savochkin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- init/Kconfig | 8 ++++++++ init/version.c | 23 ++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) (limited to 'init') diff --git a/init/Kconfig b/init/Kconfig index f7a04d0daf07..b0ea97554473 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -182,6 +182,14 @@ config TASK_DELAY_ACCT Say N if unsure. +config UTS_NS + bool "UTS Namespaces" + default n + help + Support uts namespaces. This allows containers, i.e. + vservers, to use uts namespaces to provide different + uts info for different servers. If unsure, say N. + config AUDIT bool "Auditing support" depends on NET diff --git a/init/version.c b/init/version.c index e290802c6bd2..8f28344d9c70 100644 --- a/init/version.c +++ b/init/version.c @@ -12,22 +12,27 @@ #include #include #include +#include #define version(a) Version_ ## a #define version_string(a) version(a) int version_string(LINUX_VERSION_CODE); -struct new_utsname system_utsname = { - .sysname = UTS_SYSNAME, - .nodename = UTS_NODENAME, - .release = UTS_RELEASE, - .version = UTS_VERSION, - .machine = UTS_MACHINE, - .domainname = UTS_DOMAINNAME, +struct uts_namespace init_uts_ns = { + .kref = { + .refcount = ATOMIC_INIT(2), + }, + .name = { + .sysname = UTS_SYSNAME, + .nodename = UTS_NODENAME, + .release = UTS_RELEASE, + .version = UTS_VERSION, + .machine = UTS_MACHINE, + .domainname = UTS_DOMAINNAME, + }, }; - -EXPORT_SYMBOL(system_utsname); +EXPORT_SYMBOL_GPL(init_uts_ns); const char linux_banner[] = "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" -- cgit v1.2.3-59-g8ed1b