[ARM] 4878/1: Add oabi shim for fstatat64

Ccoreutils and other have started using fstatat64. Thus, we
need a shim for it if we want to support modern oldabi
userlands (such as Debian/arm/lenny) with EABI kernels.

See http://bugs.debian.org/462677

Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Riku Voipio <riku.voipio@movial.fi>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Riku Voipio and committed by Russell King c60afe10 3085354d

+25 -1
+1 -1
arch/arm/kernel/calls.S
··· 336 336 CALL(sys_mknodat) 337 337 /* 325 */ CALL(sys_fchownat) 338 338 CALL(sys_futimesat) 339 - CALL(sys_fstatat64) 339 + CALL(ABI(sys_fstatat64, sys_oabi_fstatat64)) 340 340 CALL(sys_unlinkat) 341 341 CALL(sys_renameat) 342 342 /* 330 */ CALL(sys_linkat)
+24
arch/arm/kernel/sys_oabi-compat.c
··· 25 25 * sys_stat64: 26 26 * sys_lstat64: 27 27 * sys_fstat64: 28 + * sys_fstatat64: 28 29 * 29 30 * struct stat64 has different sizes and some members are shifted 30 31 * Compatibility wrappers are needed for them and provided below. ··· 167 166 int error = vfs_fstat(fd, &stat); 168 167 if (!error) 169 168 error = cp_oldabi_stat64(&stat, statbuf); 169 + return error; 170 + } 171 + 172 + asmlinkage long sys_oabi_fstatat64(int dfd, 173 + char __user *filename, 174 + struct oldabi_stat64 __user *statbuf, 175 + int flag) 176 + { 177 + struct kstat stat; 178 + int error = -EINVAL; 179 + 180 + if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) 181 + goto out; 182 + 183 + if (flag & AT_SYMLINK_NOFOLLOW) 184 + error = vfs_lstat_fd(dfd, filename, &stat); 185 + else 186 + error = vfs_stat_fd(dfd, filename, &stat); 187 + 188 + if (!error) 189 + error = cp_oldabi_stat64(&stat, statbuf); 190 + 191 + out: 170 192 return error; 171 193 } 172 194