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

fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT

RISC-V doesn't neeed compat_stat, so using __ARCH_WANT_COMPAT_STAT
to exclude unnecessary SYSCALL functions.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Helge Deller <deller@gmx.de> # parisc
Link: https://lore.kernel.org/r/20220405071314.3225832-6-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

authored by

Guo Ren and committed by
Palmer Dabbelt
f18ed30d 0cbed0ee

+9 -1
+1
arch/arm64/include/asm/unistd.h
··· 3 3 * Copyright (C) 2012 ARM Ltd. 4 4 */ 5 5 #ifdef CONFIG_COMPAT 6 + #define __ARCH_WANT_COMPAT_STAT 6 7 #define __ARCH_WANT_COMPAT_STAT64 7 8 #define __ARCH_WANT_SYS_GETHOSTNAME 8 9 #define __ARCH_WANT_SYS_PAUSE
+2
arch/mips/include/asm/unistd.h
··· 50 50 # ifdef CONFIG_32BIT 51 51 # define __ARCH_WANT_STAT64 52 52 # define __ARCH_WANT_SYS_TIME32 53 + # else 54 + # define __ARCH_WANT_COMPAT_STAT 53 55 # endif 54 56 # ifdef CONFIG_MIPS32_O32 55 57 # define __ARCH_WANT_SYS_TIME32
+1
arch/parisc/include/asm/unistd.h
··· 164 164 #define __ARCH_WANT_SYS_CLONE 165 165 #define __ARCH_WANT_SYS_CLONE3 166 166 #define __ARCH_WANT_COMPAT_SYS_SENDFILE 167 + #define __ARCH_WANT_COMPAT_STAT 167 168 168 169 #ifdef CONFIG_64BIT 169 170 #define __ARCH_WANT_SYS_TIME
+1
arch/powerpc/include/asm/unistd.h
··· 44 44 #define __ARCH_WANT_SYS_TIME 45 45 #define __ARCH_WANT_SYS_UTIME 46 46 #define __ARCH_WANT_SYS_NEWFSTATAT 47 + #define __ARCH_WANT_COMPAT_STAT 47 48 #define __ARCH_WANT_COMPAT_SYS_SENDFILE 48 49 #endif 49 50 #define __ARCH_WANT_SYS_FORK
+1
arch/s390/include/asm/unistd.h
··· 28 28 #define __ARCH_WANT_SYS_SIGPENDING 29 29 #define __ARCH_WANT_SYS_SIGPROCMASK 30 30 # ifdef CONFIG_COMPAT 31 + # define __ARCH_WANT_COMPAT_STAT 31 32 # define __ARCH_WANT_SYS_TIME32 32 33 # define __ARCH_WANT_SYS_UTIME32 33 34 # endif
+1
arch/sparc/include/asm/unistd.h
··· 46 46 #define __ARCH_WANT_SYS_TIME 47 47 #define __ARCH_WANT_SYS_UTIME 48 48 #define __ARCH_WANT_COMPAT_SYS_SENDFILE 49 + #define __ARCH_WANT_COMPAT_STAT 49 50 #endif 50 51 51 52 #ifdef __32bit_syscall_numbers__
+1
arch/x86/include/asm/unistd.h
··· 22 22 # include <asm/unistd_32_ia32.h> 23 23 # define __ARCH_WANT_SYS_TIME 24 24 # define __ARCH_WANT_SYS_UTIME 25 + # define __ARCH_WANT_COMPAT_STAT 25 26 # define __ARCH_WANT_COMPAT_SYS_PREADV64 26 27 # define __ARCH_WANT_COMPAT_SYS_PWRITEV64 27 28 # define __ARCH_WANT_COMPAT_SYS_PREADV64V2
+1 -1
fs/stat.c
··· 660 660 return ret; 661 661 } 662 662 663 - #ifdef CONFIG_COMPAT 663 + #if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_STAT) 664 664 static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf) 665 665 { 666 666 struct compat_stat tmp;