Skip to content

Commit 82b355d

Browse files
committed
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>
1 parent 743f5cd commit 82b355d

File tree

15 files changed

+18
-0
lines changed

15 files changed

+18
-0
lines changed

arch/alpha/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#define NR_SYSCALLS 523
88

9+
#define __ARCH_WANT_NEW_STAT
910
#define __ARCH_WANT_OLD_READDIR
1011
#define __ARCH_WANT_STAT64
1112
#define __ARCH_WANT_SYS_GETHOSTNAME

arch/arm/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <uapi/asm/unistd.h>
1717
#include <asm/unistd-nr.h>
1818

19+
#define __ARCH_WANT_NEW_STAT
1920
#define __ARCH_WANT_STAT64
2021
#define __ARCH_WANT_SYS_GETHOSTNAME
2122
#define __ARCH_WANT_SYS_PAUSE

arch/arm64/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
*/
1717

1818
#define __ARCH_WANT_RENAMEAT
19+
#define __ARCH_WANT_NEW_STAT
1920

2021
#include <asm-generic/unistd.h>

arch/ia64/include/asm/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#define __IGNORE_vfork /* clone() */
2929
#define __IGNORE_umount2 /* umount() */
3030

31+
#define __ARCH_WANT_NEW_STAT
32+
3133
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
3234

3335
#include <linux/types.h>

arch/m68k/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#define NR_syscalls 380
99

10+
#define __ARCH_WANT_NEW_STAT
1011
#define __ARCH_WANT_OLD_READDIR
1112
#define __ARCH_WANT_OLD_STAT
1213
#define __ARCH_WANT_STAT64

arch/microblaze/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
/* #define __ARCH_WANT_OLD_READDIR */
1717
/* #define __ARCH_WANT_OLD_STAT */
18+
#define __ARCH_WANT_NEW_STAT
1819
#define __ARCH_WANT_STAT64
1920
#define __ARCH_WANT_SYS_ALARM
2021
#define __ARCH_WANT_SYS_GETHOSTNAME

arch/mips/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#ifndef __ASSEMBLY__
2626

27+
#define __ARCH_WANT_NEW_STAT
2728
#define __ARCH_WANT_OLD_READDIR
2829
#define __ARCH_WANT_SYS_ALARM
2930
#define __ARCH_WANT_SYS_GETHOSTNAME

arch/parisc/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
141141
return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \
142142
}
143143

144+
#define __ARCH_WANT_NEW_STAT
144145
#define __ARCH_WANT_OLD_READDIR
145146
#define __ARCH_WANT_STAT64
146147
#define __ARCH_WANT_SYS_ALARM

arch/powerpc/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/compiler.h>
2323
#include <linux/linkage.h>
2424

25+
#define __ARCH_WANT_NEW_STAT
2526
#define __ARCH_WANT_OLD_READDIR
2627
#define __ARCH_WANT_STAT64
2728
#define __ARCH_WANT_SYS_ALARM

arch/s390/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define __IGNORE_pkey_alloc
1616
#define __IGNORE_pkey_free
1717

18+
#define __ARCH_WANT_NEW_STAT
1819
#define __ARCH_WANT_OLD_READDIR
1920
#define __ARCH_WANT_SYS_ALARM
2021
#define __ARCH_WANT_SYS_GETHOSTNAME

arch/sh/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# include <asm/unistd_64.h>
66
# endif
77

8+
# define __ARCH_WANT_NEW_STAT
89
# define __ARCH_WANT_OLD_READDIR
910
# define __ARCH_WANT_OLD_STAT
1011
# define __ARCH_WANT_STAT64

arch/sparc/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#else
2222
#define __NR_time 231 /* Linux sparc32 */
2323
#endif
24+
#define __ARCH_WANT_NEW_STAT
2425
#define __ARCH_WANT_OLD_READDIR
2526
#define __ARCH_WANT_STAT64
2627
#define __ARCH_WANT_SYS_ALARM

arch/x86/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
# endif
3333

34+
# define __ARCH_WANT_NEW_STAT
3435
# define __ARCH_WANT_OLD_READDIR
3536
# define __ARCH_WANT_OLD_STAT
3637
# define __ARCH_WANT_SYS_ALARM

arch/xtensa/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define __ARCH_WANT_SYS_CLONE
66
#include <uapi/asm/unistd.h>
77

8+
#define __ARCH_WANT_NEW_STAT
89
#define __ARCH_WANT_STAT64
910
#define __ARCH_WANT_SYS_UTIME
1011
#define __ARCH_WANT_SYS_LLSEEK

fs/stat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, stat
280280

281281
#endif /* __ARCH_WANT_OLD_STAT */
282282

283+
#ifdef __ARCH_WANT_NEW_STAT
284+
283285
#if BITS_PER_LONG == 32
284286
# define choose_32_64(a,b) a
285287
#else
@@ -378,6 +380,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
378380

379381
return error;
380382
}
383+
#endif
381384

382385
static int do_readlinkat(int dfd, const char __user *pathname,
383386
char __user *buf, int bufsiz)

0 commit comments

Comments
 (0)