y2038: Remove newstat family from default syscall set
authorArnd Bergmann <arnd@arndb.de>
Fri, 13 Apr 2018 09:50:12 +0000 (11:50 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 29 Aug 2018 13:42:20 +0000 (15:42 +0200)
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>
15 files changed:
arch/alpha/include/asm/unistd.h
arch/arm/include/asm/unistd.h
arch/arm64/include/uapi/asm/unistd.h
arch/ia64/include/asm/unistd.h
arch/m68k/include/asm/unistd.h
arch/microblaze/include/asm/unistd.h
arch/mips/include/asm/unistd.h
arch/parisc/include/asm/unistd.h
arch/powerpc/include/asm/unistd.h
arch/s390/include/asm/unistd.h
arch/sh/include/asm/unistd.h
arch/sparc/include/asm/unistd.h
arch/x86/include/asm/unistd.h
arch/xtensa/include/asm/unistd.h
fs/stat.c

index d6e29a1de4cc982a96f08d6b2c31e181a61efb30..edc090470023ebdcddb2a60000f9f73636b85dab 100644 (file)
@@ -6,6 +6,7 @@
 
 #define NR_SYSCALLS                    523
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
index 076090d2dbf5ebeec44ca4b169df2e77b1a7ed80..07e58010d5972e3761042f7a151e13dc57b783da 100644 (file)
@@ -16,6 +16,7 @@
 #include <uapi/asm/unistd.h>
 #include <asm/unistd-nr.h>
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
 #define __ARCH_WANT_SYS_PAUSE
index 5072cbd15c82955ce3fcf1a3ca828103b882248d..dae1584cf017f6aa311a5b78c3311b0bf55c2b18 100644 (file)
@@ -16,5 +16,6 @@
  */
 
 #define __ARCH_WANT_RENAMEAT
+#define __ARCH_WANT_NEW_STAT
 
 #include <asm-generic/unistd.h>
index ffb705dc9c130c0e56b6f443ce18e11872b8a3ae..c5b2620c4a4cce0fd8b7e288cd501a8bcb3796ad 100644 (file)
@@ -28,6 +28,8 @@
 #define __IGNORE_vfork         /* clone() */
 #define __IGNORE_umount2       /* umount() */
 
+#define __ARCH_WANT_NEW_STAT
+
 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
 
 #include <linux/types.h>
index 30d0d3fbd4ef9cfa0f67b9521a0d1c2f7c7e831b..db22cdadc38a9f6c2b7bec4aecf8e373eeba55c3 100644 (file)
@@ -7,6 +7,7 @@
 
 #define NR_syscalls            380
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
 #define __ARCH_WANT_STAT64
index a62d09420a47b725cf67e12b99784a2259e24d2f..a28dc770c9b23eef1f9552b83268cc48ea1768f7 100644 (file)
@@ -15,6 +15,7 @@
 
 /* #define __ARCH_WANT_OLD_READDIR */
 /* #define __ARCH_WANT_OLD_STAT */
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_ALARM
 #define __ARCH_WANT_SYS_GETHOSTNAME
index 3c09450908aa055c3b1cb6f5c43889cfe9a4e99d..d7878b3e16d83702d5cfbc1081a8eea7fc51cf4a 100644 (file)
@@ -24,6 +24,7 @@
 
 #ifndef __ASSEMBLY__
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_SYS_ALARM
 #define __ARCH_WANT_SYS_GETHOSTNAME
index 3d507d04eb4c6a505d3266cb032d0eceec68fbb9..b36273bacca7ead0d1eb47c961500ea5239a05bb 100644 (file)
@@ -141,6 +141,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)       \
     return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5);    \
 }
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_ALARM
index c19379f0a32e2b0fe59a9634140582a8afbc291e..8b37e01817be45444c7b49a22b56a93676b72872 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/compiler.h>
 #include <linux/linkage.h>
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_ALARM
index fd79c0d35dc486de3c9be4fe6d8d1951f52d600b..1d181373288a426bc8a6b8be256aa873dbed95ca 100644 (file)
@@ -15,6 +15,7 @@
 #define __IGNORE_pkey_alloc
 #define __IGNORE_pkey_free
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_SYS_ALARM
 #define __ARCH_WANT_SYS_GETHOSTNAME
index b36200af9ce7edc02a5d712cf3a430d782f60592..a845b57eac694ae6e3ebcde8a203220823a2559a 100644 (file)
@@ -5,6 +5,7 @@
 #  include <asm/unistd_64.h>
 # endif
 
+# define __ARCH_WANT_NEW_STAT
 # define __ARCH_WANT_OLD_READDIR
 # define __ARCH_WANT_OLD_STAT
 # define __ARCH_WANT_STAT64
index b2a6a955113e0a487357e24fc695f46832f6eab1..3544244685e1b33c961355d2b5d9278bb6ee721f 100644 (file)
@@ -21,6 +21,7 @@
 #else
 #define __NR_time              231 /* Linux sparc32                               */
 #endif
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_ALARM
index 51c4eee007329b8bc7ce138722dad39d67766ddf..35b66bbf8028d79a821d010e31da3843580c0312 100644 (file)
@@ -31,6 +31,7 @@
 
 # endif
 
+# define __ARCH_WANT_NEW_STAT
 # define __ARCH_WANT_OLD_READDIR
 # define __ARCH_WANT_OLD_STAT
 # define __ARCH_WANT_SYS_ALARM
index ed66db3bc9bbf795bf5e00d52456fbd0dc6e4fb5..0d532ab60b3701b8d32b5e0d23e9d5e071774b85 100644 (file)
@@ -5,6 +5,7 @@
 #define __ARCH_WANT_SYS_CLONE
 #include <uapi/asm/unistd.h>
 
+#define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_UTIME
 #define __ARCH_WANT_SYS_LLSEEK
index f8e6fb2c36576219e9ec81b44828ffc2b058fec1..adbfcd86c81b7761e6534f9cfb82f725568f0614 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -280,6 +280,8 @@ SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, stat
 
 #endif /* __ARCH_WANT_OLD_STAT */
 
+#ifdef __ARCH_WANT_NEW_STAT
+
 #if BITS_PER_LONG == 32
 #  define choose_32_64(a,b) a
 #else
@@ -378,6 +380,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
 
        return error;
 }
+#endif
 
 static int do_readlinkat(int dfd, const char __user *pathname,
                         char __user *buf, int bufsiz)