Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1352898pxb; Thu, 24 Mar 2022 18:31:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCSGiFPHnsyFEPt71K3UrarkioO0KowgFH+7QO1K1ikVQV3Bsk8Acm9x0VEayg3uYlHzBp X-Received: by 2002:a17:902:f605:b0:14d:bd53:e2cd with SMTP id n5-20020a170902f60500b0014dbd53e2cdmr8842490plg.164.1648171872673; Thu, 24 Mar 2022 18:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648171872; cv=none; d=google.com; s=arc-20160816; b=P9JxGKMuEdO0MXTLmjFjJQ0sW+XSM9f3Ph7Cwkxid0R9+cDKf1chH3MmduXg4ikJtC bRrd6mjNB6+skKde/Ruep+QmZYu3qkFsyCthwbjzYDRNB3xE+tkyIPeGdXI2+qb4U05z RFWalxX5jkS7MeSRNNUeEkyxFE5wKMn8JkEhUQZ6pCevwUU4XmHZdiTdhfgYdNJGQTuz kJXwY/aAWSs2MqGnjUIZZelfW3ZbEVjUK5TSgape3InMWIx5VWHAqX5u8iHel+AISReH zxuZMEfwv9DbGghYKs0FdO/hgpmecWntu01LEhC0hwQZwMEzDaIrdGZDweActOxPc/NO QhKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gRk0xvEP32B/lEmA/GOgcPQf18m4xshov7Zwlo0ACi0=; b=IFEn6ujneQMRQmyc3uwN+PrbjxOZSmPtBzXanOgGbhsjU4dABUHnxR0SJTxEDFtTbd H4gQ3jhLSEX3TUPN6WfepISrPfrj0mwGbg9F/3TBjiqaVdLQA7hVdPWaMnt5/EW9Rs6Z Y+6OKgpTRnO4J72OeeABgr7C8BI/vKiJ/BFojQmeUqaUMn+BdcehYJROM+VXHjoFO5R6 JlsPfCqcfi/3WcrYzWZ0DMOlLm05Sc3arHQxzcN51FK4bpxKq2kcCRcBQGPprynv67pc Pjmq9z4AGA0CAk2V8CoBfO7ZSbnctuiL/vRmWlh+pKRSYg0RCnchuYjLCMW+72mfAPVD a9pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jsSIpKbz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a170902d5c600b00153b2d16474si944419plh.124.2022.03.24.18.30.57; Thu, 24 Mar 2022 18:31:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jsSIpKbz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238018AbiCVOme (ORCPT + 99 others); Tue, 22 Mar 2022 10:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238008AbiCVOmU (ORCPT ); Tue, 22 Mar 2022 10:42:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62F607E5B0; Tue, 22 Mar 2022 07:40:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4EE63616D9; Tue, 22 Mar 2022 14:40:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCB3CC340F2; Tue, 22 Mar 2022 14:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647960051; bh=FAfiKQPv2rMf2wnvwfTmSAfgZPPOLdLw6VtizCjApcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jsSIpKbzckKHT/jQT6hlvXhnle7ZI5/tLyxcBFeUGs2cA22NJGCwKJ0V+s8FPkdXd 4vW5hHwj8cG210tAomNfhe1CRaf+SUOXBShCdUPq0s7qDL5hhFov43GCdpvYTK2ZBt PHaCVapxkjxasksDwmGp65eOGoyPYApkNAwJpd78epXLhsZgAtP3uLS6He+7/YBdfn 9RBYn1di9NFEDg1FOOrEv9Rz3mOmjfsT2/a0h5UkCAT/ODfCOuXtKy/45Fr4O1oTHi 9P8fSis+8NCo4HtFuyHnk5RbGiNhwI52wK+euRaI5jVXW5gKhalytFma86l39yK1WZ gmquf0Xtud1ag== From: guoren@kernel.org To: guoren@kernel.org, palmer@dabbelt.com, arnd@arndb.de, gregkh@linuxfoundation.org, hch@lst.de Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, heiko@sntech.de, Guo Ren Subject: [PATCH V9 05/20] fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT Date: Tue, 22 Mar 2022 22:39:48 +0800 Message-Id: <20220322144003.2357128-6-guoren@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220322144003.2357128-1-guoren@kernel.org> References: <20220322144003.2357128-1-guoren@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren RISC-V doesn't neeed compat_stat, so using __ARCH_WANT_COMPAT_STAT to exclude unnecessary SYSCALL functions. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner Cc: Palmer Dabbelt --- arch/arm64/include/asm/unistd.h | 1 + arch/mips/include/asm/unistd.h | 2 ++ arch/parisc/include/asm/unistd.h | 1 + arch/powerpc/include/asm/unistd.h | 1 + arch/s390/include/asm/unistd.h | 1 + arch/sparc/include/asm/unistd.h | 1 + arch/x86/include/asm/unistd.h | 1 + fs/stat.c | 2 +- 8 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 4e65da3445c7..037feba03a51 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -3,6 +3,7 @@ * Copyright (C) 2012 ARM Ltd. */ #ifdef CONFIG_COMPAT +#define __ARCH_WANT_COMPAT_STAT #define __ARCH_WANT_COMPAT_STAT64 #define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_PAUSE diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index c2196b1b6604..25a5253db7f4 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h @@ -50,6 +50,8 @@ # ifdef CONFIG_32BIT # define __ARCH_WANT_STAT64 # define __ARCH_WANT_SYS_TIME32 +# else +# define __ARCH_WANT_COMPAT_STAT # endif # ifdef CONFIG_MIPS32_O32 # define __ARCH_WANT_SYS_TIME32 diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index cd438e4150f6..14e0668184cb 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h @@ -168,6 +168,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE3 #define __ARCH_WANT_COMPAT_SYS_SENDFILE +#define __ARCH_WANT_COMPAT_STAT #ifdef CONFIG_64BIT #define __ARCH_WANT_SYS_TIME diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index 5eb462af6766..b1129b4ef57d 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h @@ -44,6 +44,7 @@ #define __ARCH_WANT_SYS_TIME #define __ARCH_WANT_SYS_UTIME #define __ARCH_WANT_SYS_NEWFSTATAT +#define __ARCH_WANT_COMPAT_STAT #define __ARCH_WANT_COMPAT_SYS_SENDFILE #endif #define __ARCH_WANT_SYS_FORK diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index 9e9f75ef046a..4260bc5ce7f8 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h @@ -28,6 +28,7 @@ #define __ARCH_WANT_SYS_SIGPENDING #define __ARCH_WANT_SYS_SIGPROCMASK # ifdef CONFIG_COMPAT +# define __ARCH_WANT_COMPAT_STAT # define __ARCH_WANT_SYS_TIME32 # define __ARCH_WANT_SYS_UTIME32 # endif diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index 1e66278ba4a5..d6bc76706a7a 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h @@ -46,6 +46,7 @@ #define __ARCH_WANT_SYS_TIME #define __ARCH_WANT_SYS_UTIME #define __ARCH_WANT_COMPAT_SYS_SENDFILE +#define __ARCH_WANT_COMPAT_STAT #endif #ifdef __32bit_syscall_numbers__ diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index 80e9d5206a71..761173ccc33c 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h @@ -22,6 +22,7 @@ # include # define __ARCH_WANT_SYS_TIME # define __ARCH_WANT_SYS_UTIME +# define __ARCH_WANT_COMPAT_STAT # define __ARCH_WANT_COMPAT_SYS_PREADV64 # define __ARCH_WANT_COMPAT_SYS_PWRITEV64 # define __ARCH_WANT_COMPAT_SYS_PREADV64V2 diff --git a/fs/stat.c b/fs/stat.c index 28d2020ba1f4..ffdeb9065d53 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -639,7 +639,7 @@ SYSCALL_DEFINE5(statx, return do_statx(dfd, filename, flags, mask, buffer); } -#ifdef CONFIG_COMPAT +#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_STAT) static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf) { struct compat_stat tmp; -- 2.25.1