diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2006-10-02 05:18:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-02 10:57:21 -0400 |
commit | e9ff3990f08e9a0c2839cc22808b01732ea5b3e4 (patch) | |
tree | c638a7b89f0c5e8adc410316d06ca1de8b8dabee /fs | |
parent | 0bdd7aab7f0ecd5d337910816aa058c18398628e (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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/connect.c | 22 | ||||
-rw-r--r-- | fs/exec.c | 2 | ||||
-rw-r--r-- | fs/lockd/clntproc.c | 4 | ||||
-rw-r--r-- | fs/lockd/mon.c | 2 | ||||
-rw-r--r-- | fs/lockd/svclock.c | 2 | ||||
-rw-r--r-- | fs/lockd/xdr.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfsroot.c | 2 |
7 files changed, 18 insertions, 18 deletions
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 */ |
@@ -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; |