From patchwork Thu Mar 9 15:21:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 66935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp352045wrd; Thu, 9 Mar 2023 07:26:26 -0800 (PST) X-Google-Smtp-Source: AK7set86yqvIGaeSW590gyhXLDz3I4y4lYrzrQoLkNwpUV8XlNHB5B13rU123tEKdHoqjKcpWfpp X-Received: by 2002:aa7:98de:0:b0:5df:3aa1:10c5 with SMTP id e30-20020aa798de000000b005df3aa110c5mr18660903pfm.14.1678375585919; Thu, 09 Mar 2023 07:26:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678375585; cv=pass; d=google.com; s=arc-20160816; b=ZZp1zWoSnYlZ6On57ixbb4ZgpeHkwh5zsUplsn4X/KYnlxSXtKAb6T9eOOGcSzqk0m KtMFkR5ianWVx2JBoo8DoRXjrXbdi2cQ+phWAkA3s10ObyPjNZiIxCGgmvYfXYzDYrYa i9j+8d3A2OR24gY3q3CjV2a0QtvhuY63X1b3UXCSquTLbPeQZ8whOsgtkRLzY09zYlu2 rvp66Vs2vOnsGKJ/3HS/gR3AzuHxAGvqz8I2LfNkc6HtOXIqULx/KRkcin73q0cU4gR8 XTciZgV58/mls3VfvYzUqhysf8h37pBW8VgRNIAVTrZSv1uwFgqrthb8ngaM1HWgFd/r 6bwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=KwynQujYWLmomSTW+O+riD1QybTK4tF8eo7csGlUAVc=; b=N0PC1Nvzjk6L0MtKpHIjQqds8CMSYaJFJUCjWP2J4sgsBUWS595zmgYz+2csySaQey BK3dSy6qJGISQVbyjT8EJ3r2C47CORDL28gPAXNOkjQ+UUSr0bVQTU9uk+/pKOAyxl92 CCRGXml8IWljj2l4RmdMzIHjIwzY/PcQ7dVOKygVcojG0EQ656cuz1OywFC2ezfqUmqx y9IEVv6hGY4f6o4xJDHJh/pzu7sEcOw6NNVVZ5PgC7V8AaVWspKqRVeYWxWBlDw7aqvC 2imAt0fjDnSrUVuJfbgj6Si8Iwu/8sKiBZ6K9mK5+9hxjnU0cYoGUKxlUI9frOmfxYt7 VKbA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=QNoW48ea; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q25-20020aa78439000000b005a8db48db15si17468715pfn.294.2023.03.09.07.26.12; Thu, 09 Mar 2023 07:26:25 -0800 (PST) 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=@vivo.com header.s=selector2 header.b=QNoW48ea; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231214AbjCIPWI (ORCPT + 99 others); Thu, 9 Mar 2023 10:22:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbjCIPWF (ORCPT ); Thu, 9 Mar 2023 10:22:05 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2115.outbound.protection.outlook.com [40.107.255.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC11EE77E; Thu, 9 Mar 2023 07:22:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TBZp69LbLGq3HLC+g9DslItHy6JmL9+w/Iz7oDJpbe2+mKPFnZYdfHF8QcJf6Vrw2CCfuJj2GFbQs4Ero19J+ZFaYrrnqGsjYRqppe8pdSQgkj0GShsPeElQSpoCt49/eLAGcC+6O5UM79RxTdE9YHFmRdO5C84svfEO+ckjJy+Mqjcxtxq30c2AofDp4FzlSo5oO6f4UxDMJwK7nHPloCD3KRGIRdsRMK1Q84Kj3t/CZ9yquApnEM0vWcMFydtqnlETYrPel6mpsFr5ytVm3Mhye0iXj0E9Di//1gKZ6EGHW9eSTnhw7fZWkVSQGD6XDSbmiqEcNQH4e3QNfFTbzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KwynQujYWLmomSTW+O+riD1QybTK4tF8eo7csGlUAVc=; b=SGGQlROZYZqBYiwqCGj+Z7e+5t+DutwVuif+oHYLgwW1XDtkL2C9iK4Ne1cGffwnHfT6n0JHP4L+n/WZFJ/YnTr//YiWQutG4fSIQXcXcqpuwa2JaF1cq0UUfwADogIiEUcrEFrWoRSo2uqBWMJAfgUlsWZ9T4J1syP2Ji/l9Gif0OEshzknXKN+y3Sd7PgTb3Z94MOPifeIIqKfhkyZH98ph0zGK+2jhAAgSpUBlN380miPOT+Ul1t4emJeTKOiBXlCz0LaLBYYNMDpkK0G2jFeBKGSv0XF8yqxXkFlnw9Hph+gQ1vVNlIBsSQgI7HN5Nmjd0xoLHoMCGLtTZFi9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KwynQujYWLmomSTW+O+riD1QybTK4tF8eo7csGlUAVc=; b=QNoW48eaQIMcvUo6+PcGITmRqc/cC+5Fq8oNP2n9WRcm1gqpEYHISyyp7bfGIw02SbhFOSqWXEzI+X0xQtoprUIzDyuYHfXuXqvd2zFKK9BkvrtFO0LFkGTHGq/hLt3pQ6+VaxjEf6SC3Sa3AaXWG1wCSgVS9gQJXi0vvC+OW+lPfnk09ufw+4YW6HlIaA3zG1QZfq3dOlFXr+I1P/XOwcG1xNAtp7n44cy9u7AfJmGomVeZZFsedUJ6GzRCXdMJheBUHOYA+sa2v9C9mEGLo20y25LWWWe2tO4Fu0ZLdhio9BNR/jRryM2vD6MJ7OiV+s7KkZZI7udVgJeybcefFg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SI2PR06MB4073.apcprd06.prod.outlook.com (2603:1096:4:f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 15:21:59 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.019; Thu, 9 Mar 2023 15:21:59 +0000 From: Yangtao Li To: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, tytso@mit.edu, adilger.kernel@dilger.ca, rpeterso@redhat.com, agruenba@redhat.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, viro@zeniv.linux.org.uk, brauner@kernel.org Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, Yangtao Li Subject: [PATCH v3 1/6] fs: add i_blockmask() Date: Thu, 9 Mar 2023 23:21:22 +0800 Message-Id: <20230309152127.41427-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2PR04CA0168.apcprd04.prod.outlook.com (2603:1096:4::30) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4073:EE_ X-MS-Office365-Filtering-Correlation-Id: aacda692-1cf9-40a2-33fb-08db20b20679 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G4Pjw5dPbaeSobXs+hHJALkpNaxqVrInZ3P/dUvslGuaxS5icrGf96zouh8jplvNB9vxQpnsRa4gaNPe9gzbGAgkRQuqoMpWK2YtRZrYOxi/fHbUg0iZZk8HjtMdiLqjf/ov0dojwJNNBbB/ygRySIB4bIdMEODvYaTpf3G0gVGsT0D7Jun1L25zdyUQ7QsQW1yWhfSr0+MOlLlMfqv+5xgdiGTE0/9yV5erJa68ZZueXzRTWL6oKJ9OuU8nXswEKxPdf6Sf5hNnaShnX4myd1MlY0lTD2ARtH5B90utrosTWZMq4TDVQ7rw6xlI6tyqtdGvGSVcLF3zxvUFn0vh1NBpjmbexF3RsSAnIj0JzZIh/N2GsbArXeBQUa+8qcXm3W0QJEmgOYGEtW1SNhwc7PT5S85ZuHMsis3CphPJz7RbmM200a7tUwDGJVpAcs2MkWYQi2cRBgudTs6l9WsnCyFwsL92Oc6AR6/FreBUQfHdmWY+LqBgWE9Slrq4X3+PdpDRUWf2u7sbODRjuh4UIcCi1fScvBGSQsiFA2hJ46TQ6HjXkwogwGmwjhaadTdg4JkwBll4ZuUrp2ySrxyu7VmevNbfjyYLp6VKPcMX2hJdzIL12yyxeh0lT9FPrjtv2D10vqjZ2dBlaq/Y79ryV3Uyg6BoTbLONg9I29xM/n0CUZYLqey0NKtt3hy9QrqF6Jzy2RudsrKq/ACGuN/QN+lKCqraob8o7IelUu4FL7k= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(136003)(396003)(376002)(346002)(39860400002)(451199018)(316002)(36756003)(921005)(86362001)(38350700002)(38100700002)(1076003)(6506007)(26005)(107886003)(6512007)(83380400001)(6666004)(186003)(2616005)(8936002)(5660300002)(6486002)(478600001)(7416002)(52116002)(41300700001)(4744005)(66946007)(2906002)(66556008)(8676002)(4326008)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vFx2AaYmgjQTOiYJdNJ5Y2pz5I2+7gQRUQbTGVCKvSa8v7E+P7ep3I00wZSvVfE0nFh+V+/xPB515Yiy/hhWJnlrxR2D24OkN7vT5hrKrOwK65WOdtB/q3btCg4GXr1OcU9EWW5SXgSdswmVrlvFNICPgND5kmkmOg31+mLQ/FO8TKs7y46URKav4GuVECPl3g8Ok0L3KrAnJEzy4g5Pjrv3ooz/N+BsiyGlJo2wVWrK4gOkHx2EXIT84qNpt28auIFSAmWOqLe7e8lp9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3FFJR7mV18bLy+byQatBjnhMQb6syxZcTX8Rbik+sQrcd32mOHluSAB25n0Jvyx+c0h8LnWnpD1K0eHwAi7lhyJwnDpXWLTdx4Md19zaKfKYbVwhSLY8VoKto/mpq7hLWp1kkwRQZbxsQTK9OAvELAISiCqqOBniy+WF5ditT2ovAS02OEPJdCpoXN3fheGiSJWGCw6PGoShpK+wMU5NrhcQVagMdHPE9VDkQ+Z7PmcMs3dUY+Re+9mJcAZWp0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: aacda692-1cf9-40a2-33fb-08db20b20679 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 15:21:59.0430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: otqDAUOTrXaBBUEezH21yUh1L+jDlF9Dyb8Bvsa2Kw1WC6aF8euhBTSXugH8TLCPAudua1xbzopsJ55utVQnWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759904358502262811?= X-GMAIL-MSGID: =?utf-8?q?1759904358502262811?= Introduce i_blockmask() to simplify code, which replace (i_blocksize(node) - 1). Like done in commit 93407472a21b("fs: add i_blocksize()"). Signed-off-by: Yangtao Li --- v3: -none v2: -convert to i_blockmask() include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index c85916e9f7db..17387d465b8b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -711,6 +711,11 @@ static inline unsigned int i_blocksize(const struct inode *node) return (1 << node->i_blkbits); } +static inline unsigned int i_blockmask(const struct inode *node) +{ + return i_blocksize(node) - 1; +} + static inline int inode_unhashed(struct inode *inode) { return hlist_unhashed(&inode->i_hash);