Commit 82b355d1 authored by Arnd Bergmann's avatar Arnd Bergmann

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 743f5cdb
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define NR_SYSCALLS 523 #define NR_SYSCALLS 523
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_GETHOSTNAME
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#include <asm/unistd-nr.h> #include <asm/unistd-nr.h>
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE #define __ARCH_WANT_SYS_PAUSE
......
...@@ -16,5 +16,6 @@ ...@@ -16,5 +16,6 @@
*/ */
#define __ARCH_WANT_RENAMEAT #define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_NEW_STAT
#include <asm-generic/unistd.h> #include <asm-generic/unistd.h>
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#define __IGNORE_vfork /* clone() */ #define __IGNORE_vfork /* clone() */
#define __IGNORE_umount2 /* umount() */ #define __IGNORE_umount2 /* umount() */
#define __ARCH_WANT_NEW_STAT
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
#include <linux/types.h> #include <linux/types.h>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#define NR_syscalls 380 #define NR_syscalls 380
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_OLD_STAT #define __ARCH_WANT_OLD_STAT
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
/* #define __ARCH_WANT_OLD_READDIR */ /* #define __ARCH_WANT_OLD_READDIR */
/* #define __ARCH_WANT_OLD_STAT */ /* #define __ARCH_WANT_OLD_STAT */
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
#define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_GETHOSTNAME
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
#define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_GETHOSTNAME
......
...@@ -141,6 +141,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ ...@@ -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); \ return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \
} }
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define __IGNORE_pkey_alloc #define __IGNORE_pkey_alloc
#define __IGNORE_pkey_free #define __IGNORE_pkey_free
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
#define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_GETHOSTNAME
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# include <asm/unistd_64.h> # include <asm/unistd_64.h>
# endif # endif
# define __ARCH_WANT_NEW_STAT
# define __ARCH_WANT_OLD_READDIR # define __ARCH_WANT_OLD_READDIR
# define __ARCH_WANT_OLD_STAT # define __ARCH_WANT_OLD_STAT
# define __ARCH_WANT_STAT64 # define __ARCH_WANT_STAT64
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#else #else
#define __NR_time 231 /* Linux sparc32 */ #define __NR_time 231 /* Linux sparc32 */
#endif #endif
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
# endif # endif
# define __ARCH_WANT_NEW_STAT
# define __ARCH_WANT_OLD_READDIR # define __ARCH_WANT_OLD_READDIR
# define __ARCH_WANT_OLD_STAT # define __ARCH_WANT_OLD_STAT
# define __ARCH_WANT_SYS_ALARM # define __ARCH_WANT_SYS_ALARM
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_STAT64 #define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_UTIME #define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_LLSEEK #define __ARCH_WANT_SYS_LLSEEK
......
...@@ -280,6 +280,8 @@ SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, stat ...@@ -280,6 +280,8 @@ SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, stat
#endif /* __ARCH_WANT_OLD_STAT */ #endif /* __ARCH_WANT_OLD_STAT */
#ifdef __ARCH_WANT_NEW_STAT
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
# define choose_32_64(a,b) a # define choose_32_64(a,b) a
#else #else
...@@ -378,6 +380,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf) ...@@ -378,6 +380,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
return error; return error;
} }
#endif
static int do_readlinkat(int dfd, const char __user *pathname, static int do_readlinkat(int dfd, const char __user *pathname,
char __user *buf, int bufsiz) char __user *buf, int bufsiz)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment