aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerge E. Hallyn <serue@us.ibm.com>2006-10-02 05:18:11 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-02 10:57:21 -0400
commite9ff3990f08e9a0c2839cc22808b01732ea5b3e4 (patch)
treec638a7b89f0c5e8adc410316d06ca1de8b8dabee
parent0bdd7aab7f0ecd5d337910816aa058c18398628e (diff)
[PATCH] namespaces: utsname: switch to using uts namespaces
Replace references to system_utsname to the per-process uts namespace where appropriate. This includes things like uname. Changes: Per Eric Biederman's comments, use the per-process uts namespace for ELF_PLATFORM, sunrpc, and parts of net/ipv4/ipconfig.c [jdike@addtoit.com: UML fix] [clg@fr.ibm.com: cleanup] [akpm@osdl.org: build fix] Signed-off-by: Serge E. 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: Cedric Le Goater <clg@fr.ibm.com> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/alpha/kernel/osf_sys.c26
-rw-r--r--arch/i386/kernel/sys_i386.c27
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c2
-rw-r--r--arch/m32r/kernel/sys_m32r.c2
-rw-r--r--arch/mips/kernel/linux32.c2
-rw-r--r--arch/mips/kernel/syscall.c27
-rw-r--r--arch/mips/kernel/sysirix.c12
-rw-r--r--arch/parisc/hpux/sys_hpux.c37
-rw-r--r--arch/powerpc/kernel/syscalls.c14
-rw-r--r--arch/sh/kernel/sys_sh.c2
-rw-r--r--arch/sh64/kernel/sys_sh64.c2
-rw-r--r--arch/sparc/kernel/sys_sparc.c4
-rw-r--r--arch/sparc/kernel/sys_sunos.c15
-rw-r--r--arch/sparc64/kernel/sys_sparc.c4
-rw-r--r--arch/sparc64/kernel/sys_sunos32.c10
-rw-r--r--arch/sparc64/solaris/misc.c6
-rw-r--r--arch/um/drivers/mconsole_kern.c6
-rw-r--r--arch/um/kernel/syscall.c22
-rw-r--r--arch/um/sys-x86_64/syscalls.c2
-rw-r--r--arch/x86_64/ia32/sys_ia32.c38
-rw-r--r--arch/x86_64/kernel/sys_x86_64.c2
-rw-r--r--arch/xtensa/kernel/syscalls.c2
-rw-r--r--drivers/char/random.c4
-rw-r--r--fs/cifs/connect.c22
-rw-r--r--fs/exec.c2
-rw-r--r--fs/lockd/clntproc.c4
-rw-r--r--fs/lockd/mon.c2
-rw-r--r--fs/lockd/svclock.c2
-rw-r--r--fs/lockd/xdr.c2
-rw-r--r--fs/nfs/nfsroot.c2
-rw-r--r--include/asm-i386/elf.h2
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--kernel/sys.c14
-rw-r--r--net/ipv4/ipconfig.c14
-rw-r--r--net/sunrpc/clnt.c4
35 files changed, 180 insertions, 160 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 73c7622b5297..8a31fc1bfb15 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -402,15 +402,15 @@ osf_utsname(char __user *name)
402 402
403 down_read(&uts_sem); 403 down_read(&uts_sem);
404 error = -EFAULT; 404 error = -EFAULT;
405 if (copy_to_user(name + 0, system_utsname.sysname, 32)) 405 if (copy_to_user(name + 0, utsname()->sysname, 32))
406 goto out; 406 goto out;
407 if (copy_to_user(name + 32, system_utsname.nodename, 32)) 407 if (copy_to_user(name + 32, utsname()->nodename, 32))
408 goto out; 408 goto out;
409 if (copy_to_user(name + 64, system_utsname.release, 32)) 409 if (copy_to_user(name + 64, utsname()->release, 32))
410 goto out; 410 goto out;
411 if (copy_to_user(name + 96, system_utsname.version, 32)) 411 if (copy_to_user(name + 96, utsname()->version, 32))
412 goto out; 412 goto out;
413 if (copy_to_user(name + 128, system_utsname.machine, 32)) 413 if (copy_to_user(name + 128, utsname()->machine, 32))
414 goto out; 414 goto out;
415 415
416 error = 0; 416 error = 0;
@@ -449,8 +449,8 @@ osf_getdomainname(char __user *name, int namelen)
449 449
450 down_read(&uts_sem); 450 down_read(&uts_sem);
451 for (i = 0; i < len; ++i) { 451 for (i = 0; i < len; ++i) {
452 __put_user(system_utsname.domainname[i], name + i); 452 __put_user(utsname()->domainname[i], name + i);
453 if (system_utsname.domainname[i] == '\0') 453 if (utsname()->domainname[i] == '\0')
454 break; 454 break;
455 } 455 }
456 up_read(&uts_sem); 456 up_read(&uts_sem);
@@ -607,12 +607,12 @@ osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
607asmlinkage long 607asmlinkage long
608osf_sysinfo(int command, char __user *buf, long count) 608osf_sysinfo(int command, char __user *buf, long count)
609{ 609{
610 static char * sysinfo_table[] = { 610 char *sysinfo_table[] = {
611 system_utsname.sysname, 611 utsname()->sysname,
612 system_utsname.nodename, 612 utsname()->nodename,
613 system_utsname.release, 613 utsname()->release,
614 system_utsname.version, 614 utsname()->version,
615 system_utsname.machine, 615 utsname()->machine,
616 "alpha", /* instruction set architecture */ 616 "alpha", /* instruction set architecture */
617 "dummy", /* hardware serial number */ 617 "dummy", /* hardware serial number */
618 "dummy", /* hardware manufacturer */ 618 "dummy", /* hardware manufacturer */
diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c
index 8fdb1fb17a5f..dc6e3bbeba31 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_utsname __user * name)
210 if (!name) 210 if (!name)
211 return -EFAULT; 211 return -EFAULT;
212 down_read(&uts_sem); 212 down_read(&uts_sem);
213 err=copy_to_user(name, &system_utsname, sizeof (*name)); 213 err = copy_to_user(name, utsname(), sizeof (*name));
214 up_read(&uts_sem); 214 up_read(&uts_sem);
215 return err?-EFAULT:0; 215 return err?-EFAULT:0;
216} 216}
@@ -226,16 +226,21 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
226 226
227 down_read(&uts_sem); 227 down_read(&uts_sem);
228 228
229 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); 229 error = __copy_to_user(&name->sysname, &utsname()->sysname,
230 error |= __put_user(0,name->sysname+__OLD_UTS_LEN); 230 __OLD_UTS_LEN);
231 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); 231 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
232 error |= __put_user(0,name->nodename+__OLD_UTS_LEN); 232 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
233 error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); 233 __OLD_UTS_LEN);
234 error |= __put_user(0,name->release+__OLD_UTS_LEN); 234 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
235 error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); 235 error |= __copy_to_user(&name->release, &utsname()->release,
236 error |= __put_user(0,name->version+__OLD_UTS_LEN); 236 __OLD_UTS_LEN);
237 error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 237 error |= __put_user(0, name->release + __OLD_UTS_LEN);
238 error |= __put_user(0,name->machine+__OLD_UTS_LEN); 238 error |= __copy_to_user(&name->version, &utsname()->version,
239 __OLD_UTS_LEN);
240 error |= __put_user(0, name->version + __OLD_UTS_LEN);
241 error |= __copy_to_user(&name->machine, &utsname()->machine,
242 __OLD_UTS_LEN);
243 error |= __put_user(0, name->machine + __OLD_UTS_LEN);
239 244
240 up_read(&uts_sem); 245 up_read(&uts_sem);
241 246
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index b632b9c1e3b3..462ea178f49a 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -423,7 +423,7 @@ static int sn_topology_show(struct seq_file *s, void *d)
423 "coherency_domain %d, " 423 "coherency_domain %d, "
424 "region_size %d\n", 424 "region_size %d\n",
425 425
426 partid, system_utsname.nodename, 426 partid, utsname()->nodename,
427 shubtype ? "shub2" : "shub1", 427 shubtype ? "shub2" : "shub1",
428 (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift, 428 (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift,
429 system_size, sharing_size, coher, region_size); 429 system_size, sharing_size, coher, region_size);
diff --git a/arch/m32r/kernel/sys_m32r.c b/arch/m32r/kernel/sys_m32r.c
index a9cea32eb824..7c29396cc670 100644
--- a/arch/m32r/kernel/sys_m32r.c
+++ b/arch/m32r/kernel/sys_m32r.c
@@ -205,7 +205,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
205 if (!name) 205 if (!name)
206 return -EFAULT; 206 return -EFAULT;
207 down_read(&uts_sem); 207 down_read(&uts_sem);
208 err=copy_to_user(name, &system_utsname, sizeof (*name)); 208 err = copy_to_user(name, utsname(), sizeof (*name));
209 up_read(&uts_sem); 209 up_read(&uts_sem);
210 return err?-EFAULT:0; 210 return err?-EFAULT:0;
211} 211}
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 43b1162d714f..52cada45b353 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -1039,7 +1039,7 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
1039 int ret = 0; 1039 int ret = 0;
1040 1040
1041 down_read(&uts_sem); 1041 down_read(&uts_sem);
1042 if (copy_to_user(name,&system_utsname,sizeof *name)) 1042 if (copy_to_user(name, utsname(), sizeof *name))
1043 ret = -EFAULT; 1043 ret = -EFAULT;
1044 up_read(&uts_sem); 1044 up_read(&uts_sem);
1045 1045
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 9951240cc3fd..970e3e96b1d0 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -231,7 +231,7 @@ out:
231 */ 231 */
232asmlinkage int sys_uname(struct old_utsname __user * name) 232asmlinkage int sys_uname(struct old_utsname __user * name)
233{ 233{
234 if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) 234 if (name && !copy_to_user(name, utsname(), sizeof (*name)))
235 return 0; 235 return 0;
236 return -EFAULT; 236 return -EFAULT;
237} 237}
@@ -248,16 +248,21 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
248 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) 248 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
249 return -EFAULT; 249 return -EFAULT;
250 250
251 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); 251 error = __copy_to_user(&name->sysname, &utsname()->sysname,
252 error -= __put_user(0,name->sysname+__OLD_UTS_LEN); 252 __OLD_UTS_LEN);
253 error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); 253 error -= __put_user(0, name->sysname + __OLD_UTS_LEN);
254 error -= __put_user(0,name->nodename+__OLD_UTS_LEN); 254 error -= __copy_to_user(&name->nodename, &utsname()->nodename,
255 error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); 255 __OLD_UTS_LEN);
256 error -= __put_user(0,name->release+__OLD_UTS_LEN); 256 error -= __put_user(0, name->nodename + __OLD_UTS_LEN);
257 error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); 257 error -= __copy_to_user(&name->release, &utsname()->release,
258 error -= __put_user(0,name->version+__OLD_UTS_LEN); 258 __OLD_UTS_LEN);
259 error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 259 error -= __put_user(0, name->release + __OLD_UTS_LEN);
260 error = __put_user(0,name->machine+__OLD_UTS_LEN); 260 error -= __copy_to_user(&name->version, &utsname()->version,
261 __OLD_UTS_LEN);
262 error -= __put_user(0, name->version + __OLD_UTS_LEN);
263 error -= __copy_to_user(&name->machine, &utsname()->machine,
264 __OLD_UTS_LEN);
265 error = __put_user(0, name->machine + __OLD_UTS_LEN);
261 error = error ? -EFAULT : 0; 266 error = error ? -EFAULT : 0;
262 267
263 return error; 268 return error;
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 1137dd6ea7aa..11bb97174972 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -884,7 +884,7 @@ asmlinkage int irix_getdomainname(char __user *name, int len)
884 down_read(&uts_sem); 884 down_read(&uts_sem);
885 if (len > __NEW_UTS_LEN) 885 if (len > __NEW_UTS_LEN)
886 len = __NEW_UTS_LEN; 886 len = __NEW_UTS_LEN;
887 err = copy_to_user(name, system_utsname.domainname, len) ? -EFAULT : 0; 887 err = copy_to_user(name, utsname()->domainname, len) ? -EFAULT : 0;
888 up_read(&uts_sem); 888 up_read(&uts_sem);
889 889
890 return err; 890 return err;
@@ -1127,11 +1127,11 @@ struct iuname {
1127asmlinkage int irix_uname(struct iuname __user *buf) 1127asmlinkage int irix_uname(struct iuname __user *buf)
1128{ 1128{
1129 down_read(&uts_sem); 1129 down_read(&uts_sem);
1130 if (copy_from_user(system_utsname.sysname, buf->sysname, 65) 1130 if (copy_from_user(utsname()->sysname, buf->sysname, 65)
1131 || copy_from_user(system_utsname.nodename, buf->nodename, 65) 1131 || copy_from_user(utsname()->nodename, buf->nodename, 65)
1132 || copy_from_user(system_utsname.release, buf->release, 65) 1132 || copy_from_user(utsname()->release, buf->release, 65)
1133 || copy_from_user(system_utsname.version, buf->version, 65) 1133 || copy_from_user(utsname()->version, buf->version, 65)
1134 || copy_from_user(system_utsname.machine, buf->machine, 65)) { 1134 || copy_from_user(utsname()->machine, buf->machine, 65)) {
1135 return -EFAULT; 1135 return -EFAULT;
1136 } 1136 }
1137 up_read(&uts_sem); 1137 up_read(&uts_sem);
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c
index cb69727027ae..2e2dc4f2c853 100644
--- a/arch/parisc/hpux/sys_hpux.c
+++ b/arch/parisc/hpux/sys_hpux.c
@@ -266,16 +266,21 @@ static int hpux_uname(struct hpux_utsname *name)
266 266
267 down_read(&uts_sem); 267 down_read(&uts_sem);
268 268
269 error = __copy_to_user(&name->sysname,&system_utsname.sysname,HPUX_UTSLEN-1); 269 error = __copy_to_user(&name->sysname, &utsname()->sysname,
270 error |= __put_user(0,name->sysname+HPUX_UTSLEN-1); 270 HPUX_UTSLEN - 1);
271 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,HPUX_UTSLEN-1); 271 error |= __put_user(0, name->sysname + HPUX_UTSLEN - 1);
272 error |= __put_user(0,name->nodename+HPUX_UTSLEN-1); 272 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
273 error |= __copy_to_user(&name->release,&system_utsname.release,HPUX_UTSLEN-1); 273 HPUX_UTSLEN - 1);
274 error |= __put_user(0,name->release+HPUX_UTSLEN-1); 274 error |= __put_user(0, name->nodename + HPUX_UTSLEN - 1);
275 error |= __copy_to_user(&name->version,&system_utsname.version,HPUX_UTSLEN-1); 275 error |= __copy_to_user(&name->release, &utsname()->release,
276 error |= __put_user(0,name->version+HPUX_UTSLEN-1); 276 HPUX_UTSLEN - 1);
277 error |= __copy_to_user(&name->machine,&system_utsname.machine,HPUX_UTSLEN-1); 277 error |= __put_user(0, name->release + HPUX_UTSLEN - 1);
278 error |= __put_user(0,name->machine+HPUX_UTSLEN-1); 278 error |= __copy_to_user(&name->version, &utsname()->version,
279 HPUX_UTSLEN - 1);
280 error |= __put_user(0, name->version + HPUX_UTSLEN - 1);
281 error |= __copy_to_user(&name->machine, &utsname()->machine,
282 HPUX_UTSLEN - 1);
283 error |= __put_user(0, name->machine + HPUX_UTSLEN - 1);
279 284
280 up_read(&uts_sem); 285 up_read(&uts_sem);
281 286
@@ -373,8 +378,8 @@ int hpux_utssys(char *ubuf, int n, int type)
373 /* TODO: print a warning about using this? */ 378 /* TODO: print a warning about using this? */
374 down_write(&uts_sem); 379 down_write(&uts_sem);
375 error = -EFAULT; 380 error = -EFAULT;
376 if (!copy_from_user(system_utsname.sysname, ubuf, len)) { 381 if (!copy_from_user(utsname()->sysname, ubuf, len)) {
377 system_utsname.sysname[len] = 0; 382 utsname()->sysname[len] = 0;
378 error = 0; 383 error = 0;
379 } 384 }
380 up_write(&uts_sem); 385 up_write(&uts_sem);
@@ -400,8 +405,8 @@ int hpux_utssys(char *ubuf, int n, int type)
400 /* TODO: print a warning about this? */ 405 /* TODO: print a warning about this? */
401 down_write(&uts_sem); 406 down_write(&uts_sem);
402 error = -EFAULT; 407 error = -EFAULT;
403 if (!copy_from_user(system_utsname.release, ubuf, len)) { 408 if (!copy_from_user(utsname()->release, ubuf, len)) {
404 system_utsname.release[len] = 0; 409 utsname()->release[len] = 0;
405 error = 0; 410 error = 0;
406 } 411 }
407 up_write(&uts_sem); 412 up_write(&uts_sem);
@@ -422,13 +427,13 @@ int hpux_getdomainname(char *name, int len)
422 427
423 down_read(&uts_sem); 428 down_read(&uts_sem);
424 429
425 nlen = strlen(system_utsname.domainname) + 1; 430 nlen = strlen(utsname()->domainname) + 1;
426 431
427 if (nlen < len) 432 if (nlen < len)
428 len = nlen; 433 len = nlen;
429 if(len > __NEW_UTS_LEN) 434 if(len > __NEW_UTS_LEN)
430 goto done; 435 goto done;
431 if(copy_to_user(name, system_utsname.domainname, len)) 436 if(copy_to_user(name, utsname()->domainname, len))
432 goto done; 437 goto done;
433 err = 0; 438 err = 0;
434done: 439done:
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index 9b69d99a9103..d358866b880f 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -260,7 +260,7 @@ long ppc_newuname(struct new_utsname __user * name)
260 int err = 0; 260 int err = 0;
261 261
262 down_read(&uts_sem); 262 down_read(&uts_sem);
263 if (copy_to_user(name, &system_utsname, sizeof(*name))) 263 if (copy_to_user(name, utsname(), sizeof(*name)))
264 err = -EFAULT; 264 err = -EFAULT;
265 up_read(&uts_sem); 265 up_read(&uts_sem);
266 if (!err) 266 if (!err)
@@ -273,7 +273,7 @@ int sys_uname(struct old_utsname __user *name)
273 int err = 0; 273 int err = 0;
274 274
275 down_read(&uts_sem); 275 down_read(&uts_sem);
276 if (copy_to_user(name, &system_utsname, sizeof(*name))) 276 if (copy_to_user(name, utsname(), sizeof(*name)))
277 err = -EFAULT; 277 err = -EFAULT;
278 up_read(&uts_sem); 278 up_read(&uts_sem);
279 if (!err) 279 if (!err)
@@ -289,19 +289,19 @@ int sys_olduname(struct oldold_utsname __user *name)
289 return -EFAULT; 289 return -EFAULT;
290 290
291 down_read(&uts_sem); 291 down_read(&uts_sem);
292 error = __copy_to_user(&name->sysname, &system_utsname.sysname, 292 error = __copy_to_user(&name->sysname, &utsname()->sysname,
293 __OLD_UTS_LEN); 293 __OLD_UTS_LEN);
294 error |= __put_user(0, name->sysname + __OLD_UTS_LEN); 294 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
295 error |= __copy_to_user(&name->nodename, &system_utsname.nodename, 295 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
296 __OLD_UTS_LEN); 296 __OLD_UTS_LEN);
297 error |= __put_user(0, name->nodename + __OLD_UTS_LEN); 297 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
298 error |= __copy_to_user(&name->release, &system_utsname.release, 298 error |= __copy_to_user(&name->release, &utsname()->release,
299 __OLD_UTS_LEN); 299 __OLD_UTS_LEN);
300 error |= __put_user(0, name->release + __OLD_UTS_LEN); 300 error |= __put_user(0, name->release + __OLD_UTS_LEN);
301 error |= __copy_to_user(&name->version, &system_utsname.version, 301 error |= __copy_to_user(&name->version, &utsname()->version,
302 __OLD_UTS_LEN); 302 __OLD_UTS_LEN);
303 error |= __put_user(0, name->version + __OLD_UTS_LEN); 303 error |= __put_user(0, name->version + __OLD_UTS_LEN);
304 error |= __copy_to_user(&name->machine, &system_utsname.machine, 304 error |= __copy_to_user(&name->machine, &utsname()->machine,
305 __OLD_UTS_LEN); 305 __OLD_UTS_LEN);
306 error |= override_machine(name->machine); 306 error |= override_machine(name->machine);
307 up_read(&uts_sem); 307 up_read(&uts_sem);
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
index b68ff705f067..11c2acde6eaa 100644
--- a/arch/sh/kernel/sys_sh.c
+++ b/arch/sh/kernel/sys_sh.c
@@ -281,7 +281,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
281 if (!name) 281 if (!name)
282 return -EFAULT; 282 return -EFAULT;
283 down_read(&uts_sem); 283 down_read(&uts_sem);
284 err=copy_to_user(name, &system_utsname, sizeof (*name)); 284 err = copy_to_user(name, utsname(), sizeof (*name));
285 up_read(&uts_sem); 285 up_read(&uts_sem);
286 return err?-EFAULT:0; 286 return err?-EFAULT:0;
287} 287}
diff --git a/arch/sh64/kernel/sys_sh64.c b/arch/sh64/kernel/sys_sh64.c
index 58ff7d522d81..c6de1a95af44 100644
--- a/arch/sh64/kernel/sys_sh64.c
+++ b/arch/sh64/kernel/sys_sh64.c
@@ -279,7 +279,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
279 if (!name) 279 if (!name)
280 return -EFAULT; 280 return -EFAULT;
281 down_read(&uts_sem); 281 down_read(&uts_sem);
282 err=copy_to_user(name, &system_utsname, sizeof (*name)); 282 err = copy_to_user(name, utsname(), sizeof (*name));
283 up_read(&uts_sem); 283 up_read(&uts_sem);
284 return err?-EFAULT:0; 284 return err?-EFAULT:0;
285} 285}
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 896863fb208a..002ab4dbe5cb 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -475,13 +475,13 @@ asmlinkage int sys_getdomainname(char __user *name, int len)
475 475
476 down_read(&uts_sem); 476 down_read(&uts_sem);
477 477
478 nlen = strlen(system_utsname.domainname) + 1; 478 nlen = strlen(utsname()->domainname) + 1;
479 err = -EINVAL; 479 err = -EINVAL;
480 if (nlen > len) 480 if (nlen > len)
481 goto out; 481 goto out;
482 482
483 err = -EFAULT; 483 err = -EFAULT;
484 if (!copy_to_user(name, system_utsname.domainname, nlen)) 484 if (!copy_to_user(name, utsname()->domainname, nlen))
485 err = 0; 485 err = 0;
486 486
487out: 487out:
diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c
index aa0fb2efb615..9d2cd97d1c3a 100644
--- a/arch/sparc/kernel/sys_sunos.c
+++ b/arch/sparc/kernel/sys_sunos.c
@@ -483,13 +483,18 @@ asmlinkage int sunos_uname(struct sunos_utsname __user *name)
483{ 483{
484 int ret; 484 int ret;
485 down_read(&uts_sem); 485 down_read(&uts_sem);
486 ret = copy_to_user(&name->sname[0], &system_utsname.sysname[0], sizeof(name->sname) - 1); 486 ret = copy_to_user(&name->sname[0], &utsname()->sysname[0],
487 sizeof(name->sname) - 1);
487 if (!ret) { 488 if (!ret) {
488 ret |= __copy_to_user(&name->nname[0], &system_utsname.nodename[0], sizeof(name->nname) - 1); 489 ret |= __copy_to_user(&name->nname[0], &utsname()->nodename[0],
490 sizeof(name->nname) - 1);
489 ret |= __put_user('\0', &name->nname[8]); 491 ret |= __put_user('\0', &name->nname[8]);
490 ret |= __copy_to_user(&name->rel[0], &system_utsname.release[0], sizeof(name->rel) - 1); 492 ret |= __copy_to_user(&name->rel[0], &utsname()->release[0],
491 ret |= __copy_to_user(&name->ver[0], &system_utsname.version[0], sizeof(name->ver) - 1); 493 sizeof(name->rel) - 1);
492 ret |= __copy_to_user(&name->mach[0], &system_utsname.machine[0], sizeof(name->mach) - 1); 494 ret |= __copy_to_user(&name->ver[0], &utsname()->version[0],
495 sizeof(name->ver) - 1);
496 ret |= __copy_to_user(&name->mach[0], &utsname()->machine[0],
497 sizeof(name->mach) - 1);
493 } 498 }
494 up_read(&uts_sem); 499 up_read(&uts_sem);
495 return ret ? -EFAULT : 0; 500 return ret ? -EFAULT : 0;
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index c608c947e6c3..89ac435aacc0 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -712,13 +712,13 @@ asmlinkage long sys_getdomainname(char __user *name, int len)
712 712
713 down_read(&uts_sem); 713 down_read(&uts_sem);
714 714
715 nlen = strlen(system_utsname.domainname) + 1; 715 nlen = strlen(utsname()->domainname) + 1;
716 err = -EINVAL; 716 err = -EINVAL;
717 if (nlen > len) 717 if (nlen > len)
718 goto out; 718 goto out;
719 719
720 err = -EFAULT; 720 err = -EFAULT;
721 if (!copy_to_user(name, system_utsname.domainname, nlen)) 721 if (!copy_to_user(name, utsname()->domainname, nlen))
722 err = 0; 722 err = 0;
723 723
724out: 724out:
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index 87ebdf858a3a..953296b73f3f 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -439,16 +439,16 @@ asmlinkage int sunos_uname(struct sunos_utsname __user *name)
439 int ret; 439 int ret;
440 440
441 down_read(&uts_sem); 441 down_read(&uts_sem);
442 ret = copy_to_user(&name->sname[0], &system_utsname.sysname[0], 442 ret = copy_to_user(&name->sname[0], &utsname()->sysname[0],
443 sizeof(name->sname) - 1); 443 sizeof(name->sname) - 1);
444 ret |= copy_to_user(&name->nname[0], &system_utsname.nodename[0], 444 ret |= copy_to_user(&name->nname[0], &utsname()->nodename[0],
445 sizeof(name->nname) - 1); 445 sizeof(name->nname) - 1);
446 ret |= put_user('\0', &name->nname[8]); 446 ret |= put_user('\0', &name->nname[8]);
447 ret |= copy_to_user(&name->rel[0], &system_utsname.release[0], 447 ret |= copy_to_user(&name->rel[0], &utsname()->release[0],
448 sizeof(name->rel) - 1); 448 sizeof(name->rel) - 1);
449 ret |= copy_to_user(&name->ver[0], &system_utsname.version[0], 449 ret |= copy_to_user(&name->ver[0], &utsname()->version[0],
450 sizeof(name->ver) - 1); 450 sizeof(name->ver) - 1);
451 ret |= copy_to_user(&name->mach[0], &system_utsname.machine[0], 451 ret |= copy_to_user(&name->mach[0], &utsname()->machine[0],
452 sizeof(name->mach) - 1); 452 sizeof(name->mach) - 1);
453 up_read(&uts_sem); 453 up_read(&uts_sem);
454 return (ret ? -EFAULT : 0); 454 return (ret ? -EFAULT : 0);
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
index 9c581328e76a..9ed997982f8d 100644
--- a/arch/sparc64/solaris/misc.c
+++ b/arch/sparc64/solaris/misc.c
@@ -249,7 +249,7 @@ asmlinkage int solaris_utssys(u32 buf, u32 flags, int which, u32 buf2)
249 /* Let's cheat */ 249 /* Let's cheat */
250 err = set_utsfield(v->sysname, "SunOS", 1, 0); 250 err = set_utsfield(v->sysname, "SunOS", 1, 0);
251 down_read(&uts_sem); 251 down_read(&uts_sem);
252 err |= set_utsfield(v->nodename, system_utsname.nodename, 252 err |= set_utsfield(v->nodename, utsname()->nodename,
253 1, 1); 253 1, 1);
254 up_read(&uts_sem); 254 up_read(&uts_sem);
255 err |= set_utsfield(v->release, "2.6", 0, 0); 255 err |= set_utsfield(v->release, "2.6", 0, 0);
@@ -273,7 +273,7 @@ asmlinkage int solaris_utsname(u32 buf)
273 /* Why should we not lie a bit? */ 273 /* Why should we not lie a bit? */
274 down_read(&uts_sem); 274 down_read(&uts_sem);
275 err = set_utsfield(v->sysname, "SunOS", 0, 0); 275 err = set_utsfield(v->sysname, "SunOS", 0, 0);
276 err |= set_utsfield(v->nodename, system_utsname.nodename, 1, 1); 276 err |= set_utsfield(v->nodename, utsname()->nodename, 1, 1);
277 err |= set_utsfield(v->release, "5.6", 0, 0); 277 err |= set_utsfield(v->release, "5.6", 0, 0);
278 err |= set_utsfield(v->version, "Generic", 0, 0); 278 err |= set_utsfield(v->version, "Generic", 0, 0);
279 err |= set_utsfield(v->machine, machine(), 0, 0); 279 err |= set_utsfield(v->machine, machine(), 0, 0);
@@ -305,7 +305,7 @@ asmlinkage int solaris_sysinfo(int cmd, u32 buf, s32 count)
305 case SI_HOSTNAME: 305 case SI_HOSTNAME:
306 r = buffer + 256; 306 r = buffer + 256;
307 down_read(&uts_sem); 307 down_read(&uts_sem);
308 for (p = system_utsname.nodename, q = buffer; 308 for (p = utsname()->nodename, q = buffer;
309 q < r && *p && *p != '.'; *q++ = *p++); 309 q < r && *p && *p != '.'; *q++ = *p++);
310 up_read(&uts_sem); 310 up_read(&uts_sem);
311 *q = 0; 311 *q = 0;
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 773a134e7fdb..a67dcbd78de4 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -106,9 +106,9 @@ void mconsole_version(struct mc_request *req)
106{ 106{
107 char version[256]; 107 char version[256];
108 108
109 sprintf(version, "%s %s %s %s %s", system_utsname.sysname, 109 sprintf(version, "%s %s %s %s %s", utsname()->sysname,
110 system_utsname.nodename, system_utsname.release, 110 utsname()->nodename, utsname()->release,
111 system_utsname.version, system_utsname.machine); 111 utsname()->version, utsname()->machine);
112 mconsole_reply(req, version, 0, 0); 112 mconsole_reply(req, version, 0, 0);
113} 113}
114 114
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
index 48cf88dd02d4..abf14aaf905f 100644
--- a/arch/um/kernel/syscall.c
+++ b/arch/um/kernel/syscall.c
@@ -110,7 +110,7 @@ long sys_uname(struct old_utsname __user * name)
110 if (!name) 110 if (!name)
111 return -EFAULT; 111 return -EFAULT;
112 down_read(&uts_sem); 112 down_read(&uts_sem);
113 err = copy_to_user(name, &system_utsname, sizeof (*name)); 113 err = copy_to_user(name, utsname(), sizeof (*name));
114 up_read(&uts_sem); 114 up_read(&uts_sem);
115 return err?-EFAULT:0; 115 return err?-EFAULT:0;
116} 116}
@@ -126,21 +126,21 @@ long sys_olduname(struct oldold_utsname __user * name)
126 126
127 down_read(&uts_sem); 127 down_read(&uts_sem);
128 128
129 error = __copy_to_user(&name->sysname,&system_utsname.sysname, 129 error = __copy_to_user(&name->sysname, &utsname()->sysname,
130 __OLD_UTS_LEN); 130 __OLD_UTS_LEN);
131 error |= __put_user(0,name->sysname+__OLD_UTS_LEN); 131 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
132 error |= __copy_to_user(&name->nodename,&system_utsname.nodename, 132 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
133 __OLD_UTS_LEN); 133 __OLD_UTS_LEN);
134 error |= __put_user(0,name->nodename+__OLD_UTS_LEN); 134 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
135 error |= __copy_to_user(&name->release,&system_utsname.release, 135 error |= __copy_to_user(&name->release, &utsname()->release,
136 __OLD_UTS_LEN); 136 __OLD_UTS_LEN);
137 error |= __put_user(0,name->release+__OLD_UTS_LEN); 137 error |= __put_user(0, name->release + __OLD_UTS_LEN);
138 error |= __copy_to_user(&name->version,&system_utsname.version, 138 error |= __copy_to_user(&name->version, &utsname()->version,
139 __OLD_UTS_LEN); 139 __OLD_UTS_LEN);
140 error |= __put_user(0,name->version+__OLD_UTS_LEN); 140 error |= __put_user(0, name->version + __OLD_UTS_LEN);
141 error |= __copy_to_user(&name->machine,&system_utsname.machine, 141 error |= __copy_to_user(&name->machine, &utsname()->machine,
142 __OLD_UTS_LEN); 142 __OLD_UTS_LEN);
143 error |= __put_user(0,name->machine+__OLD_UTS_LEN); 143 error |= __put_user(0, name->machine + __OLD_UTS_LEN);
144 144
145 up_read(&uts_sem); 145 up_read(&uts_sem);
146 146
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index 6fce9f45dfdc..73ce4463f70c 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -21,7 +21,7 @@ asmlinkage long sys_uname64(struct new_utsname __user * name)
21{ 21{
22 int err; 22 int err;
23 down_read(&uts_sem); 23 down_read(&uts_sem);
24 err = copy_to_user(name, &system_utsname, sizeof (*name)); 24 err = copy_to_user(name, utsname(), sizeof (*name));
25 up_read(&uts_sem); 25 up_read(&uts_sem);
26 if (personality(current->personality) == PER_LINUX32) 26 if (personality(current->personality) == PER_LINUX32)
27 err |= copy_to_user(&name->machine, "i686", 5); 27 err |= copy_to_user(&name->machine, "i686", 5);
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index f280d3665f4b..26a01717cc1a 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -784,36 +784,36 @@ asmlinkage long sys32_olduname(struct oldold_utsname __user * name)
784 784
785 if (!name) 785 if (!name)
786 return -EFAULT; 786 return -EFAULT;
787 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) 787 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
788 return -EFAULT; 788 return -EFAULT;
789 789
790 down_read(&uts_sem); 790 down_read(&uts_sem);
791 791
792 err = __copy_to_user(&name->sysname,&system_utsname.sysname, 792 err = __copy_to_user(&name->sysname,&utsname()->sysname,
793 __OLD_UTS_LEN); 793 __OLD_UTS_LEN);
794 err |= __put_user(0,name->sysname+__OLD_UTS_LEN); 794 err |= __put_user(0,name->sysname+__OLD_UTS_LEN);
795 err |= __copy_to_user(&name->nodename,&system_utsname.nodename, 795 err |= __copy_to_user(&name->nodename,&utsname()->nodename,
796 __OLD_UTS_LEN); 796 __OLD_UTS_LEN);
797 err |= __put_user(0,name->nodename+__OLD_UTS_LEN); 797 err |= __put_user(0,name->nodename+__OLD_UTS_LEN);
798 err |= __copy_to_user(&name->release,&system_utsname.release, 798 err |= __copy_to_user(&name->release,&utsname()->release,
799 __OLD_UTS_LEN); 799 __OLD_UTS_LEN);
800 err |= __put_user(0,name->release+__OLD_UTS_LEN); 800 err |= __put_user(0,name->release+__OLD_UTS_LEN);
801 err |= __copy_to_user(&name->version,&system_utsname.version, 801 err |= __copy_to_user(&name->version,&utsname()->version,
802 __OLD_UTS_LEN); 802 __OLD_UTS_LEN);
803 err |= __put_user(0,name->version+__OLD_UTS_LEN); 803 err |= __put_user(0,name->version+__OLD_UTS_LEN);
804 { 804 {
805 char *arch = "x86_64"; 805 char *arch = "x86_64";
806 if (personality(current->personality) == PER_LINUX32) 806 if (personality(current->personality) == PER_LINUX32)
807 arch = "i686"; 807 arch = "i686";
808 808
809 err |= __copy_to_user(&name->machine,arch,strlen(arch)+1); 809 err |= __copy_to_user(&name->machine, arch, strlen(arch)+1);
810 } 810 }
811 811
812 up_read(&uts_sem); 812 up_read(&uts_sem);
813 813
814 err = err ? -EFAULT : 0; 814 err = err ? -EFAULT : 0;
815 815
816 return err; 816 return err;
817} 817}
818 818
819long sys32_uname(struct old_utsname __user * name) 819long sys32_uname(struct old_utsname __user * name)
@@ -822,7 +822,7 @@ long sys32_uname(struct old_utsname __user * name)
822 if (!name) 822 if (!name)
823 return -EFAULT; 823 return -EFAULT;
824 down_read(&uts_sem); 824 down_read(&uts_sem);
825 err=copy_to_user(name, &system_utsname, sizeof (*name)); 825 err = copy_to_user(name, utsname(), sizeof (*name));
826 up_read(&uts_sem); 826 up_read(&uts_sem);
827 if (personality(current->personality) == PER_LINUX32) 827 if (personality(current->personality) == PER_LINUX32)
828 err |= copy_to_user(&name->machine, "i686", 5); 828 err |= copy_to_user(&name->machine, "i686", 5);
diff --git a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c
index 6449ea8fe756..76bf7c241fe4 100644
--- a/arch/x86_64/kernel/sys_x86_64.c
+++ b/arch/x86_64/kernel/sys_x86_64.c
@@ -148,7 +148,7 @@ asmlinkage long sys_uname(struct new_utsname __user * name)
148{ 148{
149 int err; 149 int err;
150 down_read(&uts_sem); 150 down_read(&uts_sem);
151 err = copy_to_user(name, &system_utsname, sizeof (*name)); 151 err = copy_to_user(name, utsname(), sizeof (*name));
152 up_read(&uts_sem); 152 up_read(&uts_sem);
153 if (personality(current->personality) == PER_LINUX32) 153 if (personality(current->personality) == PER_LINUX32)
154 err |= copy_to_user(&name->machine, "i686", 5); 154 err |= copy_to_user(&name->machine, "i686", 5);
diff --git a/arch/xtensa/kernel/syscalls.c b/arch/xtensa/kernel/syscalls.c
index 4688ba2db84d..37c90ca5b98d 100644
--- a/arch/xtensa/kernel/syscalls.c
+++ b/arch/xtensa/kernel/syscalls.c
@@ -128,7 +128,7 @@ out:
128 128
129int sys_uname(struct old_utsname * name) 129int sys_uname(struct old_utsname * name)
130{ 130{
131 if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) 131 if (name && !copy_to_user(name, utsname(), sizeof (*name)))
132 return 0; 132 return 0;
133 return -EFAULT; 133 return -EFAULT;
134} 134}
diff --git a/drivers/char/random.c b/drivers/char/random.c
index b430a12eb819..07f47a0208a7 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -889,8 +889,8 @@ static void init_std_data(struct entropy_store *r)
889 889
890 do_gettimeofday(&tv); 890 do_gettimeofday(&tv);
891 add_entropy_words(r, (__u32 *)&tv, sizeof(tv)/4); 891 add_entropy_words(r, (__u32 *)&tv, sizeof(tv)/4);
892 add_entropy_words(r, (__u32 *)&system_utsname, 892 add_entropy_words(r, (__u32 *)utsname(),
893 sizeof(system_utsname)/4); 893 sizeof(*(utsname()))/4);
894} 894}
895 895
896static int __init rand_initialize(void) 896static int __init rand_initialize(void)
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 0e9ba0b9d71e..c78762051da4 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -772,12 +772,12 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
772 separator[1] = 0; 772 separator[1] = 0;
773 773
774 memset(vol->source_rfc1001_name,0x20,15); 774 memset(vol->source_rfc1001_name,0x20,15);
775 for(i=0;i < strnlen(system_utsname.nodename,15);i++) { 775 for(i=0;i < strnlen(utsname()->nodename,15);i++) {
776 /* does not have to be a perfect mapping since the field is 776 /* does not have to be a perfect mapping since the field is
777 informational, only used for servers that do not support 777 informational, only used for servers that do not support
778 port 445 and it can be overridden at mount time */ 778 port 445 and it can be overridden at mount time */
779 vol->source_rfc1001_name[i] = 779 vol->source_rfc1001_name[i] =
780 toupper(system_utsname.nodename[i]); 780 toupper(utsname()->nodename[i]);
781 } 781 }
782 vol->source_rfc1001_name[15] = 0; 782 vol->source_rfc1001_name[15] = 0;
783 /* null target name indicates to use *SMBSERVR default called name 783 /* null target name indicates to use *SMBSERVR default called name
@@ -2153,7 +2153,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2153 32, nls_codepage); 2153 32, nls_codepage);
2154 bcc_ptr += 2 * bytes_returned; 2154 bcc_ptr += 2 * bytes_returned;
2155 bytes_returned = 2155 bytes_returned =
2156 cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 2156 cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release,
2157 32, nls_codepage); 2157 32, nls_codepage);
2158 bcc_ptr += 2 * bytes_returned; 2158 bcc_ptr += 2 * bytes_returned;
2159 bcc_ptr += 2; 2159 bcc_ptr += 2;
@@ -2180,8 +2180,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2180 } 2180 }
2181 strcpy(bcc_ptr, "Linux version "); 2181 strcpy(bcc_ptr, "Linux version ");
2182 bcc_ptr += strlen("Linux version "); 2182 bcc_ptr += strlen("Linux version ");
2183 strcpy(bcc_ptr, system_utsname.release); 2183 strcpy(bcc_ptr, utsname()->release);
2184 bcc_ptr += strlen(system_utsname.release) + 1; 2184 bcc_ptr += strlen(utsname()->release) + 1;
2185 strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); 2185 strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
2186 bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; 2186 bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
2187 } 2187 }
@@ -2445,7 +2445,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2445 32, nls_codepage); 2445 32, nls_codepage);
2446 bcc_ptr += 2 * bytes_returned; 2446 bcc_ptr += 2 * bytes_returned;
2447 bytes_returned = 2447 bytes_returned =
2448 cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 32, 2448 cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release, 32,
2449 nls_codepage); 2449 nls_codepage);
2450 bcc_ptr += 2 * bytes_returned; 2450 bcc_ptr += 2 * bytes_returned;
2451 bcc_ptr += 2; /* null terminate Linux version */ 2451 bcc_ptr += 2; /* null terminate Linux version */
@@ -2462,8 +2462,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2462 } else { /* ASCII */ 2462 } else { /* ASCII */
2463 strcpy(bcc_ptr, "Linux version "); 2463 strcpy(bcc_ptr, "Linux version ");
2464 bcc_ptr += strlen("Linux version "); 2464 bcc_ptr += strlen("Linux version ");
2465 strcpy(bcc_ptr, system_utsname.release); 2465 strcpy(bcc_ptr, utsname()->release);
2466 bcc_ptr += strlen(system_utsname.release) + 1; 2466 bcc_ptr += strlen(utsname()->release) + 1;
2467 strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); 2467 strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
2468 bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; 2468 bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
2469 bcc_ptr++; /* empty domain field */ 2469 bcc_ptr++; /* empty domain field */
@@ -2836,7 +2836,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2836 32, nls_codepage); 2836 32, nls_codepage);
2837 bcc_ptr += 2 * bytes_returned; 2837 bcc_ptr += 2 * bytes_returned;
2838 bytes_returned = 2838 bytes_returned =
2839 cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 32, 2839 cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release, 32,
2840 nls_codepage); 2840 nls_codepage);
2841 bcc_ptr += 2 * bytes_returned; 2841 bcc_ptr += 2 * bytes_returned;
2842 bcc_ptr += 2; /* null term version string */ 2842 bcc_ptr += 2; /* null term version string */
@@ -2888,8 +2888,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2888 2888
2889 strcpy(bcc_ptr, "Linux version "); 2889 strcpy(bcc_ptr, "Linux version ");
2890 bcc_ptr += strlen("Linux version "); 2890 bcc_ptr += strlen("Linux version ");
2891 strcpy(bcc_ptr, system_utsname.release); 2891 strcpy(bcc_ptr, utsname()->release);
2892 bcc_ptr += strlen(system_utsname.release) + 1; 2892 bcc_ptr += strlen(utsname()->release) + 1;
2893 strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); 2893 strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
2894 bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; 2894 bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
2895 bcc_ptr++; /* null domain */ 2895 bcc_ptr++; /* null domain */
diff --git a/fs/exec.c b/fs/exec.c
index 6270f8f20a63..d993ea1a81ae 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1318,7 +1318,7 @@ static void format_corename(char *corename, const char *pattern, long signr)
1318 case 'h': 1318 case 'h':
1319 down_read(&uts_sem); 1319 down_read(&uts_sem);
1320 rc = snprintf(out_ptr, out_end - out_ptr, 1320 rc = snprintf(out_ptr, out_end - out_ptr,
1321 "%s", system_utsname.nodename); 1321 "%s", utsname()->nodename);
1322 up_read(&uts_sem); 1322 up_read(&uts_sem);
1323 if (rc > out_end - out_ptr) 1323 if (rc > out_end - out_ptr)
1324 goto out; 1324 goto out;
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 271e2165fff6..0116729cec5f 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -129,11 +129,11 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
129 nlmclnt_next_cookie(&argp->cookie); 129 nlmclnt_next_cookie(&argp->cookie);
130 argp->state = nsm_local_state; 130 argp->state = nsm_local_state;
131 memcpy(&lock->fh, NFS_FH(fl->fl_file->f_dentry->d_inode), sizeof(struct nfs_fh)); 131 memcpy(&lock->fh, NFS_FH(fl->fl_file->f_dentry->d_inode), sizeof(struct nfs_fh));
132 lock->caller = system_utsname.nodename; 132 lock->caller = utsname()->nodename;
133 lock->oh.data = req->a_owner; 133 lock->oh.data = req->a_owner;
134 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s", 134 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
135 (unsigned int)fl->fl_u.nfs_fl.owner->pid, 135 (unsigned int)fl->fl_u.nfs_fl.owner->pid,
136 system_utsname.nodename); 136 utsname()->nodename);
137 lock->svid = fl->fl_u.nfs_fl.owner->pid; 137 lock->svid = fl->fl_u.nfs_fl.owner->pid;
138 lock->fl.fl_start = fl->fl_start; 138 lock->fl.fl_start = fl->fl_start;
139 lock->fl.fl_end = fl->fl_end; 139 lock->fl.fl_end = fl->fl_end;
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 5954dcb497e4..a816b920d431 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -145,7 +145,7 @@ xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
145 */ 145 */
146 sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->addr)); 146 sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->addr));
147 if (!(p = xdr_encode_string(p, buffer)) 147 if (!(p = xdr_encode_string(p, buffer))
148 || !(p = xdr_encode_string(p, system_utsname.nodename))) 148 || !(p = xdr_encode_string(p, utsname()->nodename)))
149 return ERR_PTR(-EIO); 149 return ERR_PTR(-EIO);
150 *p++ = htonl(argp->prog); 150 *p++ = htonl(argp->prog);
151 *p++ = htonl(argp->vers); 151 *p++ = htonl(argp->vers);
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index c9d419703cf3..93c00ee7189d 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -325,7 +325,7 @@ static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock)
325{ 325{
326 locks_copy_lock(&call->a_args.lock.fl, &lock->fl); 326 locks_copy_lock(&call->a_args.lock.fl, &lock->fl);
327 memcpy(&call->a_args.lock.fh, &lock->fh, sizeof(call->a_args.lock.fh)); 327 memcpy(&call->a_args.lock.fh, &lock->fh, sizeof(call->a_args.lock.fh));
328 call->a_args.lock.caller = system_utsname.nodename; 328 call->a_args.lock.caller = utsname()->nodename;
329 call->a_args.lock.oh.len = lock->oh.len; 329 call->a_args.lock.oh.len = lock->oh.len;
330 330
331 /* set default data area */ 331 /* set default data area */
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index 033ea4ac2c30..61c46facf257 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -515,7 +515,7 @@ nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
515 */ 515 */
516#define NLM_void_sz 0 516#define NLM_void_sz 0
517#define NLM_cookie_sz 1+XDR_QUADLEN(NLM_MAXCOOKIELEN) 517#define NLM_cookie_sz 1+XDR_QUADLEN(NLM_MAXCOOKIELEN)
518#define NLM_caller_sz 1+XDR_QUADLEN(sizeof(system_utsname.nodename)) 518#define NLM_caller_sz 1+XDR_QUADLEN(sizeof(utsname()->nodename))
519#define NLM_netobj_sz 1+XDR_QUADLEN(XDR_MAX_NETOBJ) 519#define NLM_netobj_sz 1+XDR_QUADLEN(XDR_MAX_NETOBJ)
520/* #define NLM_owner_sz 1+XDR_QUADLEN(NLM_MAXOWNER) */ 520/* #define NLM_owner_sz 1+XDR_QUADLEN(NLM_MAXOWNER) */
521#define NLM_fhandle_sz 1+XDR_QUADLEN(NFS2_FHSIZE) 521#define NLM_fhandle_sz 1+XDR_QUADLEN(NFS2_FHSIZE)
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index c0a754ecdee6..1d656a645199 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -312,7 +312,7 @@ static int __init root_nfs_name(char *name)
312 /* Override them by options set on kernel command-line */ 312 /* Override them by options set on kernel command-line */
313 root_nfs_parse(name, buf); 313 root_nfs_parse(name, buf);
314 314
315 cp = system_utsname.nodename; 315 cp = utsname()->nodename;
316 if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) { 316 if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) {
317 printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n"); 317 printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n");
318 return -1; 318 return -1;
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index db4344d9f73f..3a05436f31c0 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -112,7 +112,7 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
112 For the moment, we have only optimizations for the Intel generations, 112 For the moment, we have only optimizations for the Intel generations,
113 but that could change... */ 113 but that could change... */
114 114
115#define ELF_PLATFORM (system_utsname.machine) 115#define ELF_PLATFORM (utsname()->machine)
116 116
117#define SET_PERSONALITY(ex, ibcs2) do { } while (0) 117#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
118 118
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 0d92c468d55a..47b7dbd647a6 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -80,7 +80,7 @@ struct nlm_wait;
80/* 80/*
81 * Memory chunk for NLM client RPC request. 81 * Memory chunk for NLM client RPC request.
82 */ 82 */
83#define NLMCLNT_OHSIZE (sizeof(system_utsname.nodename)+10) 83#define NLMCLNT_OHSIZE (sizeof(utsname()->nodename)+10)
84struct nlm_rqst { 84struct nlm_rqst {
85 unsigned int a_flags; /* initial RPC task flags */ 85 unsigned int a_flags; /* initial RPC task flags */
86 struct nlm_host * a_host; /* host handle */ 86 struct nlm_host * a_host; /* host handle */
diff --git a/kernel/sys.c b/kernel/sys.c
index 398d57923f95..3a4776e8f16e 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1655,7 +1655,7 @@ asmlinkage long sys_newuname(struct new_utsname __user * name)
1655 int errno = 0; 1655 int errno = 0;
1656 1656
1657 down_read(&uts_sem); 1657 down_read(&uts_sem);
1658 if (copy_to_user(name,&system_utsname,sizeof *name)) 1658 if (copy_to_user(name, utsname(), sizeof *name))
1659 errno = -EFAULT; 1659 errno = -EFAULT;
1660 up_read(&uts_sem); 1660 up_read(&uts_sem);
1661 return errno; 1661 return errno;
@@ -1673,8 +1673,8 @@ asmlinkage long sys_sethostname(char __user *name, int len)
1673 down_write(&uts_sem); 1673 down_write(&uts_sem);
1674 errno = -EFAULT; 1674 errno = -EFAULT;
1675 if (!copy_from_user(tmp, name, len)) { 1675 if (!copy_from_user(tmp, name, len)) {
1676 memcpy(system_utsname.nodename, tmp, len); 1676 memcpy(utsname()->nodename, tmp, len);
1677 system_utsname.nodename[len] = 0; 1677 utsname()->nodename[len] = 0;
1678 errno = 0; 1678 errno = 0;
1679 } 1679 }
1680 up_write(&uts_sem); 1680 up_write(&uts_sem);
@@ -1690,11 +1690,11 @@ asmlinkage long sys_gethostname(char __user *name, int len)
1690 if (len < 0) 1690 if (len < 0)
1691 return -EINVAL; 1691 return -EINVAL;
1692 down_read(&uts_sem); 1692 down_read(&uts_sem);
1693 i = 1 + strlen(system_utsname.nodename); 1693 i = 1 + strlen(utsname()->nodename);
1694 if (i > len) 1694 if (i > len)
1695 i = len; 1695 i = len;
1696 errno = 0; 1696 errno = 0;
1697 if (copy_to_user(name, system_utsname.nodename, i)) 1697 if (copy_to_user(name, utsname()->nodename, i))
1698 errno = -EFAULT; 1698 errno = -EFAULT;
1699 up_read(&uts_sem); 1699 up_read(&uts_sem);
1700 return errno; 1700 return errno;
@@ -1719,8 +1719,8 @@ asmlinkage long sys_setdomainname(char __user *name, int len)
1719 down_write(&uts_sem); 1719 down_write(&uts_sem);
1720 errno = -EFAULT; 1720 errno = -EFAULT;
1721 if (!copy_from_user(tmp, name, len)) { 1721 if (!copy_from_user(tmp, name, len)) {
1722 memcpy(system_utsname.domainname, tmp, len); 1722 memcpy(utsname()->domainname, tmp, len);
1723 system_utsname.domainname[len] = 0; 1723 utsname()->domainname[len] = 0;
1724 errno = 0; 1724 errno = 0;
1725 } 1725 }
1726 up_write(&uts_sem); 1726 up_write(&uts_sem);
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 1fbb38415b19..99d50065aa79 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -805,7 +805,7 @@ static void __init ic_do_bootp_ext(u8 *ext)
805 } 805 }
806 break; 806 break;
807 case 12: /* Host name */ 807 case 12: /* Host name */
808 ic_bootp_string(system_utsname.nodename, ext+1, *ext, __NEW_UTS_LEN); 808 ic_bootp_string(utsname()->nodename, ext+1, *ext, __NEW_UTS_LEN);
809 ic_host_name_set = 1; 809 ic_host_name_set = 1;
810 break; 810 break;
811 case 15: /* Domain name (DNS) */ 811 case 15: /* Domain name (DNS) */
@@ -816,7 +816,7 @@ static void __init ic_do_bootp_ext(u8 *ext)
816 ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path)); 816 ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path));
817 break; 817 break;
818 case 40: /* NIS Domain name (_not_ DNS) */ 818 case 40: /* NIS Domain name (_not_ DNS) */
819 ic_bootp_string(system_utsname.domainname, ext+1, *ext, __NEW_UTS_LEN); 819 ic_bootp_string(utsname()->domainname, ext+1, *ext, __NEW_UTS_LEN);
820 break; 820 break;
821 } 821 }
822} 822}
@@ -1368,7 +1368,7 @@ static int __init ip_auto_config(void)
1368 printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask)); 1368 printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
1369 printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway)); 1369 printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
1370 printk(",\n host=%s, domain=%s, nis-domain=%s", 1370 printk(",\n host=%s, domain=%s, nis-domain=%s",
1371 system_utsname.nodename, ic_domain, system_utsname.domainname); 1371 utsname()->nodename, ic_domain, utsname()->domainname);
1372 printk(",\n bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr)); 1372 printk(",\n bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr));
1373 printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr)); 1373 printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr));
1374 printk(", rootpath=%s", root_server_path); 1374 printk(", rootpath=%s", root_server_path);
@@ -1478,11 +1478,11 @@ static int __init ip_auto_config_setup(char *addrs)
1478 case 4: 1478 case 4:
1479 if ((dp = strchr(ip, '.'))) { 1479 if ((dp = strchr(ip, '.'))) {
1480 *dp++ = '\0'; 1480 *dp++ = '\0';
1481 strlcpy(system_utsname.domainname, dp, 1481 strlcpy(utsname()->domainname, dp,
1482 sizeof(system_utsname.domainname)); 1482 sizeof(utsname()->domainname));
1483 } 1483 }
1484 strlcpy(system_utsname.nodename, ip, 1484 strlcpy(utsname()->nodename, ip,
1485 sizeof(system_utsname.nodename)); 1485 sizeof(utsname()->nodename));
1486 ic_host_name_set = 1; 1486 ic_host_name_set = 1;
1487 break; 1487 break;
1488 case 5: 1488 case 5:
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 124ff0ceb55b..78696f2dc7d6 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -161,10 +161,10 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
161 } 161 }
162 162
163 /* save the nodename */ 163 /* save the nodename */
164 clnt->cl_nodelen = strlen(system_utsname.nodename); 164 clnt->cl_nodelen = strlen(utsname()->nodename);
165 if (clnt->cl_nodelen > UNX_MAXNODENAME) 165 if (clnt->cl_nodelen > UNX_MAXNODENAME)
166 clnt->cl_nodelen = UNX_MAXNODENAME; 166 clnt->cl_nodelen = UNX_MAXNODENAME;
167 memcpy(clnt->cl_nodename, system_utsname.nodename, clnt->cl_nodelen); 167 memcpy(clnt->cl_nodename, utsname()->nodename, clnt->cl_nodelen);
168 return clnt; 168 return clnt;
169 169
170out_no_auth: 170out_no_auth: