OpenVZ Forum


Home » Mailing lists » Devel » [RFC][PATCH 0/5] uts namespaces: Introduction
Re: [RFC][PATCH 2/5] uts namespaces: Switch to using uts namespaces [message #2607 is a reply to message #2487] Tue, 11 April 2006 12:19 Go to previous messageGo to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Serge,

BTW, have you noticed that NFS is using utsname for internal processes
and in general case this makes NFS ns to be coupled with uts ns?

Kirill

> Replace references to system_utsname to the per-process uts namespace
> where appropriate. This includes things like uname.
>
> Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
> ---
> arch/alpha/kernel/osf_sys.c | 24 ++++++++++++------------
> arch/i386/kernel/sys_i386.c | 12 ++++++------
> arch/ia64/sn/kernel/sn2/sn_hwperf.c | 2 +-
> arch/m32r/kernel/sys_m32r.c | 2 +-
> arch/mips/kernel/linux32.c | 2 +-
> arch/mips/kernel/syscall.c | 18 +++++++++---------
> arch/mips/kernel/sysirix.c | 12 ++++++------
> arch/parisc/hpux/sys_hpux.c | 22 +++++++++++-----------
> arch/powerpc/kernel/syscalls.c | 14 +++++++-------
> arch/sh/kernel/sys_sh.c | 2 +-
> arch/sh64/kernel/sys_sh64.c | 2 +-
> arch/sparc/kernel/sys_sparc.c | 4 ++--
> arch/sparc/kernel/sys_sunos.c | 10 +++++-----
> arch/sparc64/kernel/sys_sparc.c | 4 ++--
> arch/sparc64/kernel/sys_sunos32.c | 10 +++++-----
> arch/sparc64/solaris/misc.c | 6 +++---
> arch/um/drivers/mconsole_kern.c | 6 +++---
> arch/um/kernel/syscall_kern.c | 12 ++++++------
> arch/um/sys-x86_64/syscalls.c | 2 +-
> arch/x86_64/ia32/sys_ia32.c | 10 +++++-----
> arch/x86_64/kernel/sys_x86_64.c | 2 +-
> arch/xtensa/kernel/syscalls.c | 2 +-
> drivers/char/random.c | 4 ++--
> fs/cifs/connect.c | 28 ++++++++++++++--------------
> fs/exec.c | 2 +-
> fs/lockd/clntproc.c | 4 ++--
> fs/lockd/mon.c | 2 +-
> fs/lockd/svclock.c | 2 +-
> fs/lockd/xdr.c | 2 +-
> fs/nfs/nfsroot.c | 2 +-
> include/linux/lockd/lockd.h | 2 +-
> kernel/sys.c | 14 +++++++-------
> 32 files changed, 121 insertions(+), 121 deletions(-)
>
> 92a8cf13a78415ed5ec9068698b5039ddcc00210
> diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
> index 31afe3d..b793b96 100644
> --- a/arch/alpha/kernel/osf_sys.c
> +++ b/arch/alpha/kernel/osf_sys.c
> @@ -402,15 +402,15 @@ osf_utsname(char __user *name)
>
> down_read(&uts_sem);
> error = -EFAULT;
> - if (copy_to_user(name + 0, system_utsname.sysname, 32))
> + if (copy_to_user(name + 0, utsname()->sysname, 32))
> goto out;
> - if (copy_to_user(name + 32, system_utsname.nodename, 32))
> + if (copy_to_user(name + 32, utsname()->nodename, 32))
> goto out;
> - if (copy_to_user(name + 64, system_utsname.release, 32))
> + if (copy_to_user(name + 64, utsname()->release, 32))
> goto out;
> - if (copy_to_user(name + 96, system_utsname.version, 32))
> + if (copy_to_user(name + 96, utsname()->version, 32))
> goto out;
> - if (copy_to_user(name + 128, system_utsname.machine, 32))
> + if (copy_to_user(name + 128, utsname()->machine, 32))
> goto out;
>
> error = 0;
> @@ -449,8 +449,8 @@ osf_getdomainname(char __user *name, int
>
> down_read(&uts_sem);
> for (i = 0; i < len; ++i) {
> - __put_user(system_utsname.domainname[i], name + i);
> - if (system_utsname.domainname[i] == '\0')
> + __put_user(utsname()->domainname[i], name + i);
> + if (utsname()->domainname[i] == '\0')
> break;
> }
> up_read(&uts_sem);
> @@ -608,11 +608,11 @@ asmlinkage long
> osf_sysinfo(int command, char __user *buf, long count)
> {
> static char * sysinfo_table[] = {
> - system_utsname.sysname,
> - system_utsname.nodename,
> - system_utsname.release,
> - system_utsname.version,
> - system_utsname.machine,
> + utsname()->sysname,
> + utsname()->nodename,
> + utsname()->release,
> + utsname()->version,
> + utsname()->machine,
> "alpha", /* instruction set architecture */
> "dummy", /* hardware serial number */
> "dummy", /* hardware manufacturer */
> diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c
> index 8fdb1fb..4af731d 100644
> --- a/arch/i386/kernel/sys_i386.c
> +++ b/arch/i386/kernel/sys_i386.c
> @@ -210,7 +210,7 @@ asmlinkage int sys_uname(struct old_utsn
> if (!name)
> return -EFAULT;
> down_read(&uts_sem);
> - err=copy_to_user(name, &system_utsname, sizeof (*name));
> + err=copy_to_user(name, utsname(), sizeof (*name));
> up_read(&uts_sem);
> return err?-EFAULT:0;
> }
> @@ -226,15 +226,15 @@ asmlinkage int sys_olduname(struct oldol
>
> down_read(&uts_sem);
>
> - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
> + error = __copy_to_user(&name->sysname,&utsname()->sysname,__OLD_UTS_LEN);
> error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
> - error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
> + error |= __copy_to_user(&name->nodename,&utsname()->nodename,__OLD_UTS_LEN);
> error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
> - error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
> + error |= __copy_to_user(&name->release,&utsname()->release,__OLD_UTS_LEN);
> error |= __put_user(0,name->release+__OLD_UTS_LEN);
> - error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
> + error |= __copy_to_user(&name->version,&utsname()->version,__OLD_UTS_LEN);
> error |= __put_user(0,name->version+__OLD_UTS_LEN);
> - error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
> + error |= __copy_to_user(&name->machine,&utsname()->machine,__OLD_UTS_LEN);
> error |= __put_user(0,name->machine+__OLD_UTS_LEN);
>
> up_read(&uts_sem);
> diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
> index d917afa..a0632a9 100644
> --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
> +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
> @@ -420,7 +420,7 @@ static int sn_topology_show(struct seq_f
> "coherency_domain %d, "
> "region_size %d\n",
>
> - partid, system_utsname.nodename,
> + partid, utsname()->nodename,
> shubtype ? "shub2" : "shub1",
> (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift,
> system_size, sharing_size, coher, region_size);
> diff --git a/arch/m32r/kernel/sys_m32r.c b/arch/m32r/kernel/sys_m32r.c
> index 670cb49..11412c0 100644
> --- a/arch/m32r/kernel/sys_m32r.c
> +++ b/arch/m32r/kernel/sys_m32r.c
> @@ -206,7 +206,7 @@ asmlinkage int sys_uname(struct old_utsn
> if (!name)
> return -EFAULT;
> down_read(&uts_sem);
> - err=copy_to_user(name, &system_utsname, sizeof (*name));
> + err=copy_to_user(name, utsname(), sizeof (*name));
> up_read(&uts_sem);
> return err?-EFAULT:0;
> }
> diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
> index 3f40c37..b9b702f 100644
> --- a/arch/mips/kernel/linux32.c
> +++ b/arch/mips/kernel/linux32.c
> @@ -1100,7 +1100,7 @@ asmlinkage long sys32_newuname(struct ne
> int ret = 0;
>
> down_read(&uts_sem);
> - if (copy_to_user(name,&system_utsname,sizeof *name))
> + if (copy_to_user(name,utsname(),sizeof *name))
> ret = -EFAULT;
> up_read(&uts_sem);
>
> diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
> index 2aeaa2f..8b13d57 100644
> --- a/arch/mips/kernel/syscall.c
> +++ b/arch/mips/kernel/syscall.c
> @@ -232,7 +232,7 @@ out:
> */
> asmlinkage int sys_uname(struct old_utsname __user * name)
> {
> - if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
> + if (name && !copy_to_user(name, utsname(), sizeof (*name)))
> return 0;
> return -EFAULT;
> }
> @@ -249,15 +249,15 @@ asmlinkage int sys_olduname(struct oldol
> if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
> return -EFAULT;
>
> - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
> + error = __copy_to_user(&name->sysname,&utsname()->sysname,__OLD_UTS_LEN);
> error -= __put_user(0,name->sysname+__OLD_UTS_LEN);
> - error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
> + error -= __copy_to_user(&name->nodename,&utsname()->nodename,__OLD_UTS_LEN);
> error -= __put_user(0,name->nodename+__OLD_UTS_LEN);
> - error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
> + error -= __copy_to_user(&name->release,&utsname()->release,__OLD_UTS_LEN);
> error -= __put_user(0,name->release+__OLD_UTS_LEN);
> - error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
> + error -= __copy_to_user(&name->version,&utsname()->version,__OLD_UTS_LEN);
> error -= __put_user(0,name->version+__OLD_UTS_LEN);
> - error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
> + error -= __copy_to_user(&name->machine,&utsname()->machine,__OLD_UTS_LEN);
> error = __put_user(0,name->machine+__O
...

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Projet openvz
Next Topic: [PATCH COMMIT] diff-merge-2.6.15.5-20060413
Goto Forum:
  


Current Time: Sat Aug 30 07:39:28 GMT 2025

Total time taken to generate the page: 0.11690 seconds