Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

y2038: Remove newstat family from default syscall set

We have four generations of stat() syscalls:
- the oldstat syscalls that are only used on the older architectures
- the newstat family that is used on all 64-bit architectures but
lacked support for large files on 32-bit architectures.
- the stat64 family that is used mostly on 32-bit architectures to
replace newstat
- statx() to replace all of the above, adding 64-bit timestamps among
other things.

We already compile stat64 only on those architectures that need it,
but newstat is always built, including on those that don't reference
it. This adds a new __ARCH_WANT_NEW_STAT symbol along the lines of
__ARCH_WANT_OLD_STAT and __ARCH_WANT_STAT64 to control compilation of
newstat. All architectures that need it use an explict define, the
others now get a little bit smaller, and future architecture (including
64-bit targets) won't ever see it.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+18
+1
arch/alpha/include/asm/unistd.h
··· 6 6 7 7 #define NR_SYSCALLS 523 8 8 9 + #define __ARCH_WANT_NEW_STAT 9 10 #define __ARCH_WANT_OLD_READDIR 10 11 #define __ARCH_WANT_STAT64 11 12 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/arm/include/asm/unistd.h
··· 16 16 #include <uapi/asm/unistd.h> 17 17 #include <asm/unistd-nr.h> 18 18 19 + #define __ARCH_WANT_NEW_STAT 19 20 #define __ARCH_WANT_STAT64 20 21 #define __ARCH_WANT_SYS_GETHOSTNAME 21 22 #define __ARCH_WANT_SYS_PAUSE
+1
arch/arm64/include/uapi/asm/unistd.h
··· 16 16 */ 17 17 18 18 #define __ARCH_WANT_RENAMEAT 19 + #define __ARCH_WANT_NEW_STAT 19 20 20 21 #include <asm-generic/unistd.h>
+2
arch/ia64/include/asm/unistd.h
··· 28 28 #define __IGNORE_vfork /* clone() */ 29 29 #define __IGNORE_umount2 /* umount() */ 30 30 31 + #define __ARCH_WANT_NEW_STAT 32 + 31 33 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) 32 34 33 35 #include <linux/types.h>
+1
arch/m68k/include/asm/unistd.h
··· 7 7 8 8 #define NR_syscalls 380 9 9 10 + #define __ARCH_WANT_NEW_STAT 10 11 #define __ARCH_WANT_OLD_READDIR 11 12 #define __ARCH_WANT_OLD_STAT 12 13 #define __ARCH_WANT_STAT64
+1
arch/microblaze/include/asm/unistd.h
··· 15 15 16 16 /* #define __ARCH_WANT_OLD_READDIR */ 17 17 /* #define __ARCH_WANT_OLD_STAT */ 18 + #define __ARCH_WANT_NEW_STAT 18 19 #define __ARCH_WANT_STAT64 19 20 #define __ARCH_WANT_SYS_ALARM 20 21 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/mips/include/asm/unistd.h
··· 24 24 25 25 #ifndef __ASSEMBLY__ 26 26 27 + #define __ARCH_WANT_NEW_STAT 27 28 #define __ARCH_WANT_OLD_READDIR 28 29 #define __ARCH_WANT_SYS_ALARM 29 30 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/parisc/include/asm/unistd.h
··· 141 141 return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \ 142 142 } 143 143 144 + #define __ARCH_WANT_NEW_STAT 144 145 #define __ARCH_WANT_OLD_READDIR 145 146 #define __ARCH_WANT_STAT64 146 147 #define __ARCH_WANT_SYS_ALARM
+1
arch/powerpc/include/asm/unistd.h
··· 22 22 #include <linux/compiler.h> 23 23 #include <linux/linkage.h> 24 24 25 + #define __ARCH_WANT_NEW_STAT 25 26 #define __ARCH_WANT_OLD_READDIR 26 27 #define __ARCH_WANT_STAT64 27 28 #define __ARCH_WANT_SYS_ALARM
+1
arch/s390/include/asm/unistd.h
··· 15 15 #define __IGNORE_pkey_alloc 16 16 #define __IGNORE_pkey_free 17 17 18 + #define __ARCH_WANT_NEW_STAT 18 19 #define __ARCH_WANT_OLD_READDIR 19 20 #define __ARCH_WANT_SYS_ALARM 20 21 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/sh/include/asm/unistd.h
··· 5 5 # include <asm/unistd_64.h> 6 6 # endif 7 7 8 + # define __ARCH_WANT_NEW_STAT 8 9 # define __ARCH_WANT_OLD_READDIR 9 10 # define __ARCH_WANT_OLD_STAT 10 11 # define __ARCH_WANT_STAT64
+1
arch/sparc/include/asm/unistd.h
··· 21 21 #else 22 22 #define __NR_time 231 /* Linux sparc32 */ 23 23 #endif 24 + #define __ARCH_WANT_NEW_STAT 24 25 #define __ARCH_WANT_OLD_READDIR 25 26 #define __ARCH_WANT_STAT64 26 27 #define __ARCH_WANT_SYS_ALARM
+1
arch/x86/include/asm/unistd.h
··· 31 31 32 32 # endif 33 33 34 + # define __ARCH_WANT_NEW_STAT 34 35 # define __ARCH_WANT_OLD_READDIR 35 36 # define __ARCH_WANT_OLD_STAT 36 37 # define __ARCH_WANT_SYS_ALARM
+1
arch/xtensa/include/asm/unistd.h
··· 5 5 #define __ARCH_WANT_SYS_CLONE 6 6 #include <uapi/asm/unistd.h> 7 7 8 + #define __ARCH_WANT_NEW_STAT 8 9 #define __ARCH_WANT_STAT64 9 10 #define __ARCH_WANT_SYS_UTIME 10 11 #define __ARCH_WANT_SYS_LLSEEK
+3
fs/stat.c
··· 280 280 281 281 #endif /* __ARCH_WANT_OLD_STAT */ 282 282 283 + #ifdef __ARCH_WANT_NEW_STAT 284 + 283 285 #if BITS_PER_LONG == 32 284 286 # define choose_32_64(a,b) a 285 287 #else ··· 380 378 381 379 return error; 382 380 } 381 + #endif 383 382 384 383 static int do_readlinkat(int dfd, const char __user *pathname, 385 384 char __user *buf, int bufsiz)