diff options
31 files changed, 5 insertions, 466 deletions
diff --git a/fs/namei.c b/fs/namei.c index 6c76e1ee9c45..095818089ac1 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/file.h> | 31 | #include <linux/file.h> |
32 | #include <linux/fcntl.h> | 32 | #include <linux/fcntl.h> |
33 | #include <linux/device_cgroup.h> | 33 | #include <linux/device_cgroup.h> |
34 | #include <asm/namei.h> | ||
35 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
36 | 35 | ||
37 | #define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE]) | 36 | #define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE]) |
@@ -562,27 +561,16 @@ out_unlock: | |||
562 | return result; | 561 | return result; |
563 | } | 562 | } |
564 | 563 | ||
565 | static int __emul_lookup_dentry(const char *, struct nameidata *); | ||
566 | |||
567 | /* SMP-safe */ | 564 | /* SMP-safe */ |
568 | static __always_inline int | 565 | static __always_inline void |
569 | walk_init_root(const char *name, struct nameidata *nd) | 566 | walk_init_root(const char *name, struct nameidata *nd) |
570 | { | 567 | { |
571 | struct fs_struct *fs = current->fs; | 568 | struct fs_struct *fs = current->fs; |
572 | 569 | ||
573 | read_lock(&fs->lock); | 570 | read_lock(&fs->lock); |
574 | if (fs->altroot.dentry && !(nd->flags & LOOKUP_NOALT)) { | ||
575 | nd->path = fs->altroot; | ||
576 | path_get(&fs->altroot); | ||
577 | read_unlock(&fs->lock); | ||
578 | if (__emul_lookup_dentry(name,nd)) | ||
579 | return 0; | ||
580 | read_lock(&fs->lock); | ||
581 | } | ||
582 | nd->path = fs->root; | 571 | nd->path = fs->root; |
583 | path_get(&fs->root); | 572 | path_get(&fs->root); |
584 | read_unlock(&fs->lock); | 573 | read_unlock(&fs->lock); |
585 | return 1; | ||
586 | } | 574 | } |
587 | 575 | ||
588 | /* | 576 | /* |
@@ -623,12 +611,9 @@ static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *l | |||
623 | 611 | ||
624 | if (*link == '/') { | 612 | if (*link == '/') { |
625 | path_put(&nd->path); | 613 | path_put(&nd->path); |
626 | if (!walk_init_root(link, nd)) | 614 | walk_init_root(link, nd); |
627 | /* weird __emul_prefix() stuff did it */ | ||
628 | goto out; | ||
629 | } | 615 | } |
630 | res = link_path_walk(link, nd); | 616 | res = link_path_walk(link, nd); |
631 | out: | ||
632 | if (nd->depth || res || nd->last_type!=LAST_NORM) | 617 | if (nd->depth || res || nd->last_type!=LAST_NORM) |
633 | return res; | 618 | return res; |
634 | /* | 619 | /* |
@@ -1077,67 +1062,6 @@ static int path_walk(const char *name, struct nameidata *nd) | |||
1077 | return link_path_walk(name, nd); | 1062 | return link_path_walk(name, nd); |
1078 | } | 1063 | } |
1079 | 1064 | ||
1080 | /* | ||
1081 | * SMP-safe: Returns 1 and nd will have valid dentry and mnt, if | ||
1082 | * everything is done. Returns 0 and drops input nd, if lookup failed; | ||
1083 | */ | ||
1084 | static int __emul_lookup_dentry(const char *name, struct nameidata *nd) | ||
1085 | { | ||
1086 | if (path_walk(name, nd)) | ||
1087 | return 0; /* something went wrong... */ | ||
1088 | |||
1089 | if (!nd->path.dentry->d_inode || | ||
1090 | S_ISDIR(nd->path.dentry->d_inode->i_mode)) { | ||
1091 | struct path old_path = nd->path; | ||
1092 | struct qstr last = nd->last; | ||
1093 | int last_type = nd->last_type; | ||
1094 | struct fs_struct *fs = current->fs; | ||
1095 | |||
1096 | /* | ||
1097 | * NAME was not found in alternate root or it's a directory. | ||
1098 | * Try to find it in the normal root: | ||
1099 | */ | ||
1100 | nd->last_type = LAST_ROOT; | ||
1101 | read_lock(&fs->lock); | ||
1102 | nd->path = fs->root; | ||
1103 | path_get(&fs->root); | ||
1104 | read_unlock(&fs->lock); | ||
1105 | if (path_walk(name, nd) == 0) { | ||
1106 | if (nd->path.dentry->d_inode) { | ||
1107 | path_put(&old_path); | ||
1108 | return 1; | ||
1109 | } | ||
1110 | path_put(&nd->path); | ||
1111 | } | ||
1112 | nd->path = old_path; | ||
1113 | nd->last = last; | ||
1114 | nd->last_type = last_type; | ||
1115 | } | ||
1116 | return 1; | ||
1117 | } | ||
1118 | |||
1119 | void set_fs_altroot(void) | ||
1120 | { | ||
1121 | char *emul = __emul_prefix(); | ||
1122 | struct nameidata nd; | ||
1123 | struct path path = {}, old_path; | ||
1124 | int err; | ||
1125 | struct fs_struct *fs = current->fs; | ||
1126 | |||
1127 | if (!emul) | ||
1128 | goto set_it; | ||
1129 | err = path_lookup(emul, LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_NOALT, &nd); | ||
1130 | if (!err) | ||
1131 | path = nd.path; | ||
1132 | set_it: | ||
1133 | write_lock(&fs->lock); | ||
1134 | old_path = fs->altroot; | ||
1135 | fs->altroot = path; | ||
1136 | write_unlock(&fs->lock); | ||
1137 | if (old_path.dentry) | ||
1138 | path_put(&old_path); | ||
1139 | } | ||
1140 | |||
1141 | /* Returns 0 and nd will be valid on success; Retuns error, otherwise. */ | 1065 | /* Returns 0 and nd will be valid on success; Retuns error, otherwise. */ |
1142 | static int do_path_lookup(int dfd, const char *name, | 1066 | static int do_path_lookup(int dfd, const char *name, |
1143 | unsigned int flags, struct nameidata *nd) | 1067 | unsigned int flags, struct nameidata *nd) |
@@ -1153,14 +1077,6 @@ static int do_path_lookup(int dfd, const char *name, | |||
1153 | 1077 | ||
1154 | if (*name=='/') { | 1078 | if (*name=='/') { |
1155 | read_lock(&fs->lock); | 1079 | read_lock(&fs->lock); |
1156 | if (fs->altroot.dentry && !(nd->flags & LOOKUP_NOALT)) { | ||
1157 | nd->path = fs->altroot; | ||
1158 | path_get(&fs->altroot); | ||
1159 | read_unlock(&fs->lock); | ||
1160 | if (__emul_lookup_dentry(name,nd)) | ||
1161 | goto out; /* found in altroot */ | ||
1162 | read_lock(&fs->lock); | ||
1163 | } | ||
1164 | nd->path = fs->root; | 1080 | nd->path = fs->root; |
1165 | path_get(&fs->root); | 1081 | path_get(&fs->root); |
1166 | read_unlock(&fs->lock); | 1082 | read_unlock(&fs->lock); |
@@ -1194,7 +1110,6 @@ static int do_path_lookup(int dfd, const char *name, | |||
1194 | } | 1110 | } |
1195 | 1111 | ||
1196 | retval = path_walk(name, nd); | 1112 | retval = path_walk(name, nd); |
1197 | out: | ||
1198 | if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry && | 1113 | if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry && |
1199 | nd->path.dentry->d_inode)) | 1114 | nd->path.dentry->d_inode)) |
1200 | audit_inode(name, nd->path.dentry); | 1115 | audit_inode(name, nd->path.dentry); |
diff --git a/fs/namespace.c b/fs/namespace.c index f30b11e2240e..c4fcf48acef8 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1972,7 +1972,7 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns, | |||
1972 | struct fs_struct *fs) | 1972 | struct fs_struct *fs) |
1973 | { | 1973 | { |
1974 | struct mnt_namespace *new_ns; | 1974 | struct mnt_namespace *new_ns; |
1975 | struct vfsmount *rootmnt = NULL, *pwdmnt = NULL, *altrootmnt = NULL; | 1975 | struct vfsmount *rootmnt = NULL, *pwdmnt = NULL; |
1976 | struct vfsmount *p, *q; | 1976 | struct vfsmount *p, *q; |
1977 | 1977 | ||
1978 | new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL); | 1978 | new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL); |
@@ -2015,10 +2015,6 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns, | |||
2015 | pwdmnt = p; | 2015 | pwdmnt = p; |
2016 | fs->pwd.mnt = mntget(q); | 2016 | fs->pwd.mnt = mntget(q); |
2017 | } | 2017 | } |
2018 | if (p == fs->altroot.mnt) { | ||
2019 | altrootmnt = p; | ||
2020 | fs->altroot.mnt = mntget(q); | ||
2021 | } | ||
2022 | } | 2018 | } |
2023 | p = next_mnt(p, mnt_ns->root); | 2019 | p = next_mnt(p, mnt_ns->root); |
2024 | q = next_mnt(q, new_ns->root); | 2020 | q = next_mnt(q, new_ns->root); |
@@ -2029,8 +2025,6 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns, | |||
2029 | mntput(rootmnt); | 2025 | mntput(rootmnt); |
2030 | if (pwdmnt) | 2026 | if (pwdmnt) |
2031 | mntput(pwdmnt); | 2027 | mntput(pwdmnt); |
2032 | if (altrootmnt) | ||
2033 | mntput(altrootmnt); | ||
2034 | 2028 | ||
2035 | return new_ns; | 2029 | return new_ns; |
2036 | } | 2030 | } |
@@ -548,7 +548,7 @@ asmlinkage long sys_chroot(const char __user * filename) | |||
548 | struct nameidata nd; | 548 | struct nameidata nd; |
549 | int error; | 549 | int error; |
550 | 550 | ||
551 | error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd); | 551 | error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &nd); |
552 | if (error) | 552 | if (error) |
553 | goto out; | 553 | goto out; |
554 | 554 | ||
@@ -561,7 +561,6 @@ asmlinkage long sys_chroot(const char __user * filename) | |||
561 | goto dput_and_out; | 561 | goto dput_and_out; |
562 | 562 | ||
563 | set_fs_root(current->fs, &nd.path); | 563 | set_fs_root(current->fs, &nd.path); |
564 | set_fs_altroot(); | ||
565 | error = 0; | 564 | error = 0; |
566 | dput_and_out: | 565 | dput_and_out: |
567 | path_put(&nd.path); | 566 | path_put(&nd.path); |
diff --git a/include/asm-alpha/namei.h b/include/asm-alpha/namei.h deleted file mode 100644 index 5cc9bb39499d..000000000000 --- a/include/asm-alpha/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $ | ||
2 | * linux/include/asm-alpha/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __ALPHA_NAMEI_H | ||
8 | #define __ALPHA_NAMEI_H | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif /* __ALPHA_NAMEI_H */ | ||
diff --git a/include/asm-arm/namei.h b/include/asm-arm/namei.h deleted file mode 100644 index a402d3b9d0f7..000000000000 --- a/include/asm-arm/namei.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/namei.h | ||
3 | * | ||
4 | * Routines to handle famous /usr/gnemul | ||
5 | * Derived from the Sparc version of this file | ||
6 | * | ||
7 | * Included from linux/fs/namei.c | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASMARM_NAMEI_H | ||
11 | #define __ASMARM_NAMEI_H | ||
12 | |||
13 | #define ARM_BSD_EMUL "usr/gnemul/bsd/" | ||
14 | |||
15 | static inline char *__emul_prefix(void) | ||
16 | { | ||
17 | switch (current->personality) { | ||
18 | case PER_BSD: | ||
19 | return ARM_BSD_EMUL; | ||
20 | default: | ||
21 | return NULL; | ||
22 | } | ||
23 | } | ||
24 | |||
25 | #endif /* __ASMARM_NAMEI_H */ | ||
diff --git a/include/asm-avr32/namei.h b/include/asm-avr32/namei.h deleted file mode 100644 index f0a26de06cab..000000000000 --- a/include/asm-avr32/namei.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_NAMEI_H | ||
2 | #define __ASM_AVR32_NAMEI_H | ||
3 | |||
4 | /* This dummy routine may be changed to something useful */ | ||
5 | #define __emul_prefix() NULL | ||
6 | |||
7 | #endif /* __ASM_AVR32_NAMEI_H */ | ||
diff --git a/include/asm-blackfin/namei.h b/include/asm-blackfin/namei.h deleted file mode 100644 index 8b89a2d65cb4..000000000000 --- a/include/asm-blackfin/namei.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | * | ||
6 | * Changes made by Lineo Inc. May 2001 | ||
7 | */ | ||
8 | |||
9 | #ifndef __BFIN_NAMEI_H | ||
10 | #define __BFIN_NAMEI_H | ||
11 | |||
12 | /* This dummy routine maybe changed to something useful | ||
13 | * for /usr/gnemul/ emulation stuff. | ||
14 | * Look at asm-sparc/namei.h for details. | ||
15 | */ | ||
16 | |||
17 | #define __emul_prefix() NULL | ||
18 | |||
19 | #endif | ||
diff --git a/include/asm-cris/namei.h b/include/asm-cris/namei.h deleted file mode 100644 index 8a3be7a6d9f6..000000000000 --- a/include/asm-cris/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* $Id: namei.h,v 1.1 2000/07/10 16:32:31 bjornw Exp $ | ||
2 | * linux/include/asm-cris/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __CRIS_NAMEI_H | ||
8 | #define __CRIS_NAMEI_H | ||
9 | |||
10 | /* used to find file-system prefixes for doing emulations | ||
11 | * see for example asm-sparc/namei.h | ||
12 | * we don't use it... | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif /* __CRIS_NAMEI_H */ | ||
diff --git a/include/asm-frv/namei.h b/include/asm-frv/namei.h deleted file mode 100644 index 4ea57171d951..000000000000 --- a/include/asm-frv/namei.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-frv/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __ASM_NAMEI_H | ||
8 | #define __ASM_NAMEI_H | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif | ||
18 | |||
diff --git a/include/asm-h8300/namei.h b/include/asm-h8300/namei.h deleted file mode 100644 index ab6f196db6e0..000000000000 --- a/include/asm-h8300/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-h8300/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __H8300_NAMEI_H | ||
8 | #define __H8300_NAMEI_H | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif | ||
diff --git a/include/asm-ia64/namei.h b/include/asm-ia64/namei.h deleted file mode 100644 index 78e768079083..000000000000 --- a/include/asm-ia64/namei.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef _ASM_IA64_NAMEI_H | ||
2 | #define _ASM_IA64_NAMEI_H | ||
3 | |||
4 | /* | ||
5 | * Modified 1998, 1999, 2001 | ||
6 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
7 | */ | ||
8 | |||
9 | #include <asm/ptrace.h> | ||
10 | #include <asm/system.h> | ||
11 | |||
12 | #define EMUL_PREFIX_LINUX_IA32 "/emul/ia32-linux/" | ||
13 | |||
14 | static inline char * | ||
15 | __emul_prefix (void) | ||
16 | { | ||
17 | switch (current->personality) { | ||
18 | case PER_LINUX32: | ||
19 | return EMUL_PREFIX_LINUX_IA32; | ||
20 | default: | ||
21 | return NULL; | ||
22 | } | ||
23 | } | ||
24 | |||
25 | #endif /* _ASM_IA64_NAMEI_H */ | ||
diff --git a/include/asm-m32r/namei.h b/include/asm-m32r/namei.h deleted file mode 100644 index 210f8056b805..000000000000 --- a/include/asm-m32r/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef _ASM_M32R_NAMEI_H | ||
2 | #define _ASM_M32R_NAMEI_H | ||
3 | |||
4 | /* | ||
5 | * linux/include/asm-m32r/namei.h | ||
6 | * | ||
7 | * Included from linux/fs/namei.c | ||
8 | */ | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif /* _ASM_M32R_NAMEI_H */ | ||
diff --git a/include/asm-m68k/namei.h b/include/asm-m68k/namei.h deleted file mode 100644 index f33f243b644a..000000000000 --- a/include/asm-m68k/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-m68k/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __M68K_NAMEI_H | ||
8 | #define __M68K_NAMEI_H | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif | ||
diff --git a/include/asm-m68knommu/namei.h b/include/asm-m68knommu/namei.h deleted file mode 100644 index 31a85d27b931..000000000000 --- a/include/asm-m68knommu/namei.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-m68k/namei.h> | ||
diff --git a/include/asm-mips/namei.h b/include/asm-mips/namei.h deleted file mode 100644 index a6605a752469..000000000000 --- a/include/asm-mips/namei.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _ASM_NAMEI_H | ||
2 | #define _ASM_NAMEI_H | ||
3 | |||
4 | /* | ||
5 | * This dummy routine maybe changed to something useful | ||
6 | * for /usr/gnemul/ emulation stuff. | ||
7 | */ | ||
8 | |||
9 | #define __emul_prefix() NULL | ||
10 | |||
11 | #endif /* _ASM_NAMEI_H */ | ||
diff --git a/include/asm-mn10300/namei.h b/include/asm-mn10300/namei.h deleted file mode 100644 index bd9ce94aeb65..000000000000 --- a/include/asm-mn10300/namei.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* Emulation stuff | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_NAMEI_H | ||
13 | #define _ASM_NAMEI_H | ||
14 | |||
15 | /* This dummy routine maybe changed to something useful | ||
16 | * for /usr/gnemul/ emulation stuff. | ||
17 | * Look at asm-sparc/namei.h for details. | ||
18 | */ | ||
19 | |||
20 | #define __emul_prefix() NULL | ||
21 | |||
22 | #endif /* _ASM_NAMEI_H */ | ||
diff --git a/include/asm-parisc/namei.h b/include/asm-parisc/namei.h deleted file mode 100644 index 8d29b3d9fb33..000000000000 --- a/include/asm-parisc/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $ | ||
2 | * linux/include/asm-parisc/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __PARISC_NAMEI_H | ||
8 | #define __PARISC_NAMEI_H | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif /* __PARISC_NAMEI_H */ | ||
diff --git a/include/asm-powerpc/namei.h b/include/asm-powerpc/namei.h deleted file mode 100644 index 657443474a6a..000000000000 --- a/include/asm-powerpc/namei.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _ASM_POWERPC_NAMEI_H | ||
2 | #define _ASM_POWERPC_NAMEI_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* | ||
7 | * Adapted from include/asm-alpha/namei.h | ||
8 | * | ||
9 | * Included from fs/namei.c | ||
10 | */ | ||
11 | |||
12 | /* This dummy routine maybe changed to something useful | ||
13 | * for /usr/gnemul/ emulation stuff. | ||
14 | * Look at asm-sparc/namei.h for details. | ||
15 | */ | ||
16 | |||
17 | #define __emul_prefix() NULL | ||
18 | |||
19 | #endif /* __KERNEL__ */ | ||
20 | #endif /* _ASM_POWERPC_NAMEI_H */ | ||
diff --git a/include/asm-s390/namei.h b/include/asm-s390/namei.h deleted file mode 100644 index 3e286bdde4b0..000000000000 --- a/include/asm-s390/namei.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-s390/namei.h | ||
3 | * | ||
4 | * S390 version | ||
5 | * | ||
6 | * Derived from "include/asm-i386/namei.h" | ||
7 | * | ||
8 | * Included from linux/fs/namei.c | ||
9 | */ | ||
10 | |||
11 | #ifndef __S390_NAMEI_H | ||
12 | #define __S390_NAMEI_H | ||
13 | |||
14 | /* This dummy routine maybe changed to something useful | ||
15 | * for /usr/gnemul/ emulation stuff. | ||
16 | * Look at asm-sparc/namei.h for details. | ||
17 | */ | ||
18 | |||
19 | #define __emul_prefix() NULL | ||
20 | |||
21 | #endif /* __S390_NAMEI_H */ | ||
diff --git a/include/asm-sh/namei.h b/include/asm-sh/namei.h deleted file mode 100644 index 338a5d947143..000000000000 --- a/include/asm-sh/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* $Id: namei.h,v 1.3 2000/07/04 06:24:49 gniibe Exp $ | ||
2 | * linux/include/asm-sh/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __ASM_SH_NAMEI_H | ||
8 | #define __ASM_SH_NAMEI_H | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif /* __ASM_SH_NAMEI_H */ | ||
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h deleted file mode 100644 index eff944b8e321..000000000000 --- a/include/asm-sparc/namei.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef ___ASM_SPARC_NAMEI_H | ||
2 | #define ___ASM_SPARC_NAMEI_H | ||
3 | #if defined(__sparc__) && defined(__arch64__) | ||
4 | #include <asm-sparc/namei_64.h> | ||
5 | #else | ||
6 | #include <asm-sparc/namei_32.h> | ||
7 | #endif | ||
8 | #endif | ||
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h deleted file mode 100644 index 1344a910ba2f..000000000000 --- a/include/asm-sparc64/namei.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-sparc/namei.h> | ||
diff --git a/include/asm-um/namei.h b/include/asm-um/namei.h deleted file mode 100644 index 002984d5bc85..000000000000 --- a/include/asm-um/namei.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __UM_NAMEI_H | ||
2 | #define __UM_NAMEI_H | ||
3 | |||
4 | #include "asm/arch/namei.h" | ||
5 | |||
6 | #endif | ||
diff --git a/include/asm-v850/namei.h b/include/asm-v850/namei.h deleted file mode 100644 index ee8339b23843..000000000000 --- a/include/asm-v850/namei.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-v850/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | */ | ||
6 | |||
7 | #ifndef __V850_NAMEI_H__ | ||
8 | #define __V850_NAMEI_H__ | ||
9 | |||
10 | /* This dummy routine maybe changed to something useful | ||
11 | * for /usr/gnemul/ emulation stuff. | ||
12 | * Look at asm-sparc/namei.h for details. | ||
13 | */ | ||
14 | |||
15 | #define __emul_prefix() NULL | ||
16 | |||
17 | #endif /* __V850_NAMEI_H__ */ | ||
diff --git a/include/asm-x86/namei.h b/include/asm-x86/namei.h deleted file mode 100644 index 415ef5d9550e..000000000000 --- a/include/asm-x86/namei.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _ASM_X86_NAMEI_H | ||
2 | #define _ASM_X86_NAMEI_H | ||
3 | |||
4 | /* This dummy routine maybe changed to something useful | ||
5 | * for /usr/gnemul/ emulation stuff. | ||
6 | * Look at asm-sparc/namei.h for details. | ||
7 | */ | ||
8 | |||
9 | #define __emul_prefix() NULL | ||
10 | |||
11 | #endif /* _ASM_X86_NAMEI_H */ | ||
diff --git a/include/asm-xtensa/namei.h b/include/asm-xtensa/namei.h deleted file mode 100644 index 3fdff039d27d..000000000000 --- a/include/asm-xtensa/namei.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/namei.h | ||
3 | * | ||
4 | * Included from linux/fs/namei.c | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_NAMEI_H | ||
14 | #define _XTENSA_NAMEI_H | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | /* This dummy routine maybe changed to something useful | ||
19 | * for /usr/gnemul/ emulation stuff. | ||
20 | * Look at asm-sparc/namei.h for details. | ||
21 | */ | ||
22 | |||
23 | #define __emul_prefix() NULL | ||
24 | |||
25 | #endif /* __KERNEL__ */ | ||
26 | #endif /* _XTENSA_NAMEI_H */ | ||
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 282f54219129..9e5a06e78d02 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
@@ -7,7 +7,7 @@ struct fs_struct { | |||
7 | atomic_t count; | 7 | atomic_t count; |
8 | rwlock_t lock; | 8 | rwlock_t lock; |
9 | int umask; | 9 | int umask; |
10 | struct path root, pwd, altroot; | 10 | struct path root, pwd; |
11 | }; | 11 | }; |
12 | 12 | ||
13 | #define INIT_FS { \ | 13 | #define INIT_FS { \ |
@@ -19,7 +19,6 @@ struct fs_struct { | |||
19 | extern struct kmem_cache *fs_cachep; | 19 | extern struct kmem_cache *fs_cachep; |
20 | 20 | ||
21 | extern void exit_fs(struct task_struct *); | 21 | extern void exit_fs(struct task_struct *); |
22 | extern void set_fs_altroot(void); | ||
23 | extern void set_fs_root(struct fs_struct *, struct path *); | 22 | extern void set_fs_root(struct fs_struct *, struct path *); |
24 | extern void set_fs_pwd(struct fs_struct *, struct path *); | 23 | extern void set_fs_pwd(struct fs_struct *, struct path *); |
25 | extern struct fs_struct *copy_fs_struct(struct fs_struct *); | 24 | extern struct fs_struct *copy_fs_struct(struct fs_struct *); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 3cf62d26d493..768773d57857 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -47,7 +47,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
47 | #define LOOKUP_DIRECTORY 2 | 47 | #define LOOKUP_DIRECTORY 2 |
48 | #define LOOKUP_CONTINUE 4 | 48 | #define LOOKUP_CONTINUE 4 |
49 | #define LOOKUP_PARENT 16 | 49 | #define LOOKUP_PARENT 16 |
50 | #define LOOKUP_NOALT 32 | ||
51 | #define LOOKUP_REVAL 64 | 50 | #define LOOKUP_REVAL 64 |
52 | /* | 51 | /* |
53 | * Intent data | 52 | * Intent data |
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index c1ef192aa655..0d407e886735 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c | |||
@@ -168,7 +168,6 @@ __set_personality(u_long personality) | |||
168 | current->personality = personality; | 168 | current->personality = personality; |
169 | oep = current_thread_info()->exec_domain; | 169 | oep = current_thread_info()->exec_domain; |
170 | current_thread_info()->exec_domain = ep; | 170 | current_thread_info()->exec_domain = ep; |
171 | set_fs_altroot(); | ||
172 | 171 | ||
173 | module_put(oep->module); | 172 | module_put(oep->module); |
174 | return 0; | 173 | return 0; |
diff --git a/kernel/exit.c b/kernel/exit.c index 6cdf60712bd2..0caf590548a0 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -565,8 +565,6 @@ void put_fs_struct(struct fs_struct *fs) | |||
565 | if (atomic_dec_and_test(&fs->count)) { | 565 | if (atomic_dec_and_test(&fs->count)) { |
566 | path_put(&fs->root); | 566 | path_put(&fs->root); |
567 | path_put(&fs->pwd); | 567 | path_put(&fs->pwd); |
568 | if (fs->altroot.dentry) | ||
569 | path_put(&fs->altroot); | ||
570 | kmem_cache_free(fs_cachep, fs); | 568 | kmem_cache_free(fs_cachep, fs); |
571 | } | 569 | } |
572 | } | 570 | } |
diff --git a/kernel/fork.c b/kernel/fork.c index abb3ed6298f6..5e050c1317c4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -657,13 +657,6 @@ static struct fs_struct *__copy_fs_struct(struct fs_struct *old) | |||
657 | path_get(&old->root); | 657 | path_get(&old->root); |
658 | fs->pwd = old->pwd; | 658 | fs->pwd = old->pwd; |
659 | path_get(&old->pwd); | 659 | path_get(&old->pwd); |
660 | if (old->altroot.dentry) { | ||
661 | fs->altroot = old->altroot; | ||
662 | path_get(&old->altroot); | ||
663 | } else { | ||
664 | fs->altroot.mnt = NULL; | ||
665 | fs->altroot.dentry = NULL; | ||
666 | } | ||
667 | read_unlock(&old->lock); | 660 | read_unlock(&old->lock); |
668 | } | 661 | } |
669 | return fs; | 662 | return fs; |