diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/sys_oabi-compat.c | 19 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 18 | ||||
-rw-r--r-- | arch/sparc/kernel/sys_sparc32.c | 19 | ||||
-rw-r--r-- | arch/x86/ia32/sys_ia32.c | 19 |
4 files changed, 20 insertions, 55 deletions
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c index e04173c7e621..d59a0cd537f0 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c | |||
@@ -177,21 +177,12 @@ asmlinkage long sys_oabi_fstatat64(int dfd, | |||
177 | int flag) | 177 | int flag) |
178 | { | 178 | { |
179 | struct kstat stat; | 179 | struct kstat stat; |
180 | int error = -EINVAL; | 180 | int error; |
181 | 181 | ||
182 | if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) | 182 | error = vfs_fstatat(dfd, filename, &stat, flag); |
183 | goto out; | 183 | if (error) |
184 | 184 | return error; | |
185 | if (flag & AT_SYMLINK_NOFOLLOW) | 185 | return cp_oldabi_stat64(&stat, statbuf); |
186 | error = vfs_lstat_fd(dfd, filename, &stat); | ||
187 | else | ||
188 | error = vfs_stat_fd(dfd, filename, &stat); | ||
189 | |||
190 | if (!error) | ||
191 | error = cp_oldabi_stat64(&stat, statbuf); | ||
192 | |||
193 | out: | ||
194 | return error; | ||
195 | } | 186 | } |
196 | 187 | ||
197 | struct oabi_flock64 { | 188 | struct oabi_flock64 { |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 6cc87d8c8682..002c70d3cb75 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -702,20 +702,12 @@ asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, | |||
702 | struct stat64_emu31 __user* statbuf, int flag) | 702 | struct stat64_emu31 __user* statbuf, int flag) |
703 | { | 703 | { |
704 | struct kstat stat; | 704 | struct kstat stat; |
705 | int error = -EINVAL; | 705 | int error; |
706 | |||
707 | if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) | ||
708 | goto out; | ||
709 | |||
710 | if (flag & AT_SYMLINK_NOFOLLOW) | ||
711 | error = vfs_lstat_fd(dfd, filename, &stat); | ||
712 | else | ||
713 | error = vfs_stat_fd(dfd, filename, &stat); | ||
714 | 706 | ||
715 | if (!error) | 707 | error = vfs_fstatat(dfd, filename, &stat, flag); |
716 | error = cp_stat64(statbuf, &stat); | 708 | if (error) |
717 | out: | 709 | return error; |
718 | return error; | 710 | return cp_stat64(statbuf, &stat); |
719 | } | 711 | } |
720 | 712 | ||
721 | /* | 713 | /* |
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index e800503879e4..f5000a460c05 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c | |||
@@ -206,21 +206,12 @@ asmlinkage long compat_sys_fstatat64(unsigned int dfd, char __user *filename, | |||
206 | struct compat_stat64 __user * statbuf, int flag) | 206 | struct compat_stat64 __user * statbuf, int flag) |
207 | { | 207 | { |
208 | struct kstat stat; | 208 | struct kstat stat; |
209 | int error = -EINVAL; | 209 | int error; |
210 | |||
211 | if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) | ||
212 | goto out; | ||
213 | |||
214 | if (flag & AT_SYMLINK_NOFOLLOW) | ||
215 | error = vfs_lstat_fd(dfd, filename, &stat); | ||
216 | else | ||
217 | error = vfs_stat_fd(dfd, filename, &stat); | ||
218 | |||
219 | if (!error) | ||
220 | error = cp_compat_stat64(&stat, statbuf); | ||
221 | 210 | ||
222 | out: | 211 | error = vfs_fstatat(dfd, filename, &stat, flag); |
223 | return error; | 212 | if (error) |
213 | return error; | ||
214 | return cp_compat_stat64(&stat, statbuf); | ||
224 | } | 215 | } |
225 | 216 | ||
226 | asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2) | 217 | asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2) |
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index efac92fd1efb..085a8c35f149 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
@@ -129,21 +129,12 @@ asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename, | |||
129 | struct stat64 __user *statbuf, int flag) | 129 | struct stat64 __user *statbuf, int flag) |
130 | { | 130 | { |
131 | struct kstat stat; | 131 | struct kstat stat; |
132 | int error = -EINVAL; | 132 | int error; |
133 | 133 | ||
134 | if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) | 134 | error = vfs_fstatat(dfd, filename, &stat, flag); |
135 | goto out; | 135 | if (error) |
136 | 136 | return error; | |
137 | if (flag & AT_SYMLINK_NOFOLLOW) | 137 | return cp_stat64(statbuf, &stat); |
138 | error = vfs_lstat_fd(dfd, filename, &stat); | ||
139 | else | ||
140 | error = vfs_stat_fd(dfd, filename, &stat); | ||
141 | |||
142 | if (!error) | ||
143 | error = cp_stat64(statbuf, &stat); | ||
144 | |||
145 | out: | ||
146 | return error; | ||
147 | } | 138 | } |
148 | 139 | ||
149 | /* | 140 | /* |