summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-04-13 05:50:12 -0400
committerArnd Bergmann <arnd@arndb.de>2018-08-29 09:42:20 -0400
commit82b355d161c9525ab8838cc27d3200bc3bc9082d (patch)
treedb0e1dc34aad8e44b2c4a19dd83652dc33390422
parent743f5cdb6cec33d2300922f6b1b1670a572595ad (diff)
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>
-rw-r--r--arch/alpha/include/asm/unistd.h1
-rw-r--r--arch/arm/include/asm/unistd.h1
-rw-r--r--arch/arm64/include/uapi/asm/unistd.h1
-rw-r--r--arch/ia64/include/asm/unistd.h2
-rw-r--r--arch/m68k/include/asm/unistd.h1
-rw-r--r--arch/microblaze/include/asm/unistd.h1
-rw-r--r--arch/mips/include/asm/unistd.h1
-rw-r--r--arch/parisc/include/asm/unistd.h1
-rw-r--r--arch/powerpc/include/asm/unistd.h1
-rw-r--r--arch/s390/include/asm/unistd.h1
-rw-r--r--arch/sh/include/asm/unistd.h1
-rw-r--r--arch/sparc/include/asm/unistd.h1
-rw-r--r--arch/x86/include/asm/unistd.h1
-rw-r--r--arch/xtensa/include/asm/unistd.h1
-rw-r--r--fs/stat.c3
15 files changed, 18 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h
index d6e29a1de4cc..edc090470023 100644
--- a/arch/alpha/include/asm/unistd.h
+++ b/arch/alpha/include/asm/unistd.h
@@ -6,6 +6,7 @@
6 6
7#define NR_SYSCALLS 523 7#define NR_SYSCALLS 523
8 8
9#define __ARCH_WANT_NEW_STAT
9#define __ARCH_WANT_OLD_READDIR 10#define __ARCH_WANT_OLD_READDIR
10#define __ARCH_WANT_STAT64 11#define __ARCH_WANT_STAT64
11#define __ARCH_WANT_SYS_GETHOSTNAME 12#define __ARCH_WANT_SYS_GETHOSTNAME
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 076090d2dbf5..07e58010d597 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -16,6 +16,7 @@
16#include <uapi/asm/unistd.h> 16#include <uapi/asm/unistd.h>
17#include <asm/unistd-nr.h> 17#include <asm/unistd-nr.h>
18 18
19#define __ARCH_WANT_NEW_STAT
19#define __ARCH_WANT_STAT64 20#define __ARCH_WANT_STAT64
20#define __ARCH_WANT_SYS_GETHOSTNAME 21#define __ARCH_WANT_SYS_GETHOSTNAME
21#define __ARCH_WANT_SYS_PAUSE 22#define __ARCH_WANT_SYS_PAUSE
diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
index 5072cbd15c82..dae1584cf017 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -16,5 +16,6 @@
16 */ 16 */
17 17
18#define __ARCH_WANT_RENAMEAT 18#define __ARCH_WANT_RENAMEAT
19#define __ARCH_WANT_NEW_STAT
19 20
20#include <asm-generic/unistd.h> 21#include <asm-generic/unistd.h>
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
index ffb705dc9c13..c5b2620c4a4c 100644
--- a/arch/ia64/include/asm/unistd.h
+++ b/arch/ia64/include/asm/unistd.h
@@ -28,6 +28,8 @@
28#define __IGNORE_vfork /* clone() */ 28#define __IGNORE_vfork /* clone() */
29#define __IGNORE_umount2 /* umount() */ 29#define __IGNORE_umount2 /* umount() */
30 30
31#define __ARCH_WANT_NEW_STAT
32
31#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) 33#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
32 34
33#include <linux/types.h> 35#include <linux/types.h>
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h
index 30d0d3fbd4ef..db22cdadc38a 100644
--- a/arch/m68k/include/asm/unistd.h
+++ b/arch/m68k/include/asm/unistd.h
@@ -7,6 +7,7 @@
7 7
8#define NR_syscalls 380 8#define NR_syscalls 380
9 9
10#define __ARCH_WANT_NEW_STAT
10#define __ARCH_WANT_OLD_READDIR 11#define __ARCH_WANT_OLD_READDIR
11#define __ARCH_WANT_OLD_STAT 12#define __ARCH_WANT_OLD_STAT
12#define __ARCH_WANT_STAT64 13#define __ARCH_WANT_STAT64
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h
index a62d09420a47..a28dc770c9b2 100644
--- a/arch/microblaze/include/asm/unistd.h
+++ b/arch/microblaze/include/asm/unistd.h
@@ -15,6 +15,7 @@
15 15
16/* #define __ARCH_WANT_OLD_READDIR */ 16/* #define __ARCH_WANT_OLD_READDIR */
17/* #define __ARCH_WANT_OLD_STAT */ 17/* #define __ARCH_WANT_OLD_STAT */
18#define __ARCH_WANT_NEW_STAT
18#define __ARCH_WANT_STAT64 19#define __ARCH_WANT_STAT64
19#define __ARCH_WANT_SYS_ALARM 20#define __ARCH_WANT_SYS_ALARM
20#define __ARCH_WANT_SYS_GETHOSTNAME 21#define __ARCH_WANT_SYS_GETHOSTNAME
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 3c09450908aa..d7878b3e16d8 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -24,6 +24,7 @@
24 24
25#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
26 26
27#define __ARCH_WANT_NEW_STAT
27#define __ARCH_WANT_OLD_READDIR 28#define __ARCH_WANT_OLD_READDIR
28#define __ARCH_WANT_SYS_ALARM 29#define __ARCH_WANT_SYS_ALARM
29#define __ARCH_WANT_SYS_GETHOSTNAME 30#define __ARCH_WANT_SYS_GETHOSTNAME
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index 3d507d04eb4c..b36273bacca7 100644
--- a/arch/parisc/include/asm/unistd.h
+++ b/arch/parisc/include/asm/unistd.h
@@ -141,6 +141,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
141 return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \ 141 return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \
142} 142}
143 143
144#define __ARCH_WANT_NEW_STAT
144#define __ARCH_WANT_OLD_READDIR 145#define __ARCH_WANT_OLD_READDIR
145#define __ARCH_WANT_STAT64 146#define __ARCH_WANT_STAT64
146#define __ARCH_WANT_SYS_ALARM 147#define __ARCH_WANT_SYS_ALARM
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index c19379f0a32e..8b37e01817be 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -22,6 +22,7 @@
22#include <linux/compiler.h> 22#include <linux/compiler.h>
23#include <linux/linkage.h> 23#include <linux/linkage.h>
24 24
25#define __ARCH_WANT_NEW_STAT
25#define __ARCH_WANT_OLD_READDIR 26#define __ARCH_WANT_OLD_READDIR
26#define __ARCH_WANT_STAT64 27#define __ARCH_WANT_STAT64
27#define __ARCH_WANT_SYS_ALARM 28#define __ARCH_WANT_SYS_ALARM
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h
index fd79c0d35dc4..1d181373288a 100644
--- a/arch/s390/include/asm/unistd.h
+++ b/arch/s390/include/asm/unistd.h
@@ -15,6 +15,7 @@
15#define __IGNORE_pkey_alloc 15#define __IGNORE_pkey_alloc
16#define __IGNORE_pkey_free 16#define __IGNORE_pkey_free
17 17
18#define __ARCH_WANT_NEW_STAT
18#define __ARCH_WANT_OLD_READDIR 19#define __ARCH_WANT_OLD_READDIR
19#define __ARCH_WANT_SYS_ALARM 20#define __ARCH_WANT_SYS_ALARM
20#define __ARCH_WANT_SYS_GETHOSTNAME 21#define __ARCH_WANT_SYS_GETHOSTNAME
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h
index b36200af9ce7..a845b57eac69 100644
--- a/arch/sh/include/asm/unistd.h
+++ b/arch/sh/include/asm/unistd.h
@@ -5,6 +5,7 @@
5# include <asm/unistd_64.h> 5# include <asm/unistd_64.h>
6# endif 6# endif
7 7
8# define __ARCH_WANT_NEW_STAT
8# define __ARCH_WANT_OLD_READDIR 9# define __ARCH_WANT_OLD_READDIR
9# define __ARCH_WANT_OLD_STAT 10# define __ARCH_WANT_OLD_STAT
10# define __ARCH_WANT_STAT64 11# define __ARCH_WANT_STAT64
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h
index b2a6a955113e..3544244685e1 100644
--- a/arch/sparc/include/asm/unistd.h
+++ b/arch/sparc/include/asm/unistd.h
@@ -21,6 +21,7 @@
21#else 21#else
22#define __NR_time 231 /* Linux sparc32 */ 22#define __NR_time 231 /* Linux sparc32 */
23#endif 23#endif
24#define __ARCH_WANT_NEW_STAT
24#define __ARCH_WANT_OLD_READDIR 25#define __ARCH_WANT_OLD_READDIR
25#define __ARCH_WANT_STAT64 26#define __ARCH_WANT_STAT64
26#define __ARCH_WANT_SYS_ALARM 27#define __ARCH_WANT_SYS_ALARM
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h
index 51c4eee00732..35b66bbf8028 100644
--- a/arch/x86/include/asm/unistd.h
+++ b/arch/x86/include/asm/unistd.h
@@ -31,6 +31,7 @@
31 31
32# endif 32# endif
33 33
34# define __ARCH_WANT_NEW_STAT
34# define __ARCH_WANT_OLD_READDIR 35# define __ARCH_WANT_OLD_READDIR
35# define __ARCH_WANT_OLD_STAT 36# define __ARCH_WANT_OLD_STAT
36# define __ARCH_WANT_SYS_ALARM 37# define __ARCH_WANT_SYS_ALARM
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h
index ed66db3bc9bb..0d532ab60b37 100644
--- a/arch/xtensa/include/asm/unistd.h
+++ b/arch/xtensa/include/asm/unistd.h
@@ -5,6 +5,7 @@
5#define __ARCH_WANT_SYS_CLONE 5#define __ARCH_WANT_SYS_CLONE
6#include <uapi/asm/unistd.h> 6#include <uapi/asm/unistd.h>
7 7
8#define __ARCH_WANT_NEW_STAT
8#define __ARCH_WANT_STAT64 9#define __ARCH_WANT_STAT64
9#define __ARCH_WANT_SYS_UTIME 10#define __ARCH_WANT_SYS_UTIME
10#define __ARCH_WANT_SYS_LLSEEK 11#define __ARCH_WANT_SYS_LLSEEK
diff --git a/fs/stat.c b/fs/stat.c
index f8e6fb2c3657..adbfcd86c81b 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -280,6 +280,8 @@ SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, stat
280 280
281#endif /* __ARCH_WANT_OLD_STAT */ 281#endif /* __ARCH_WANT_OLD_STAT */
282 282
283#ifdef __ARCH_WANT_NEW_STAT
284
283#if BITS_PER_LONG == 32 285#if BITS_PER_LONG == 32
284# define choose_32_64(a,b) a 286# define choose_32_64(a,b) a
285#else 287#else
@@ -378,6 +380,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
378 380
379 return error; 381 return error;
380} 382}
383#endif
381 384
382static int do_readlinkat(int dfd, const char __user *pathname, 385static int do_readlinkat(int dfd, const char __user *pathname,
383 char __user *buf, int bufsiz) 386 char __user *buf, int bufsiz)