From patchwork Thu Mar 9 12:40:31 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: 66833 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp271046wrd; Thu, 9 Mar 2023 04:53:16 -0800 (PST) X-Google-Smtp-Source: AK7set/q1sSBWINGzsmyzwCIUROd0is7h+6R3Q2dQKoQlg5rR/GQRqGZv6ir+K8cyRPJ45FDMuWn X-Received: by 2002:a17:902:b488:b0:19d:19fb:55ec with SMTP id y8-20020a170902b48800b0019d19fb55ecmr17060752plr.6.1678366396589; Thu, 09 Mar 2023 04:53:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678366396; cv=pass; d=google.com; s=arc-20160816; b=BZkxX0e1BCYZvBwP3NlXcz8kWlA5ufxIJJoKdcCMgA5rprEucvitJTTSoQl0pOVzA8 xiSfQE71AkNutU6tuOz5jLCnz2gOB7wnXSHgSh+0zta2XLVGWEAATdgZahmY6XTY1r1D Txre0KGbJ8JsQ9ydeAPYWQYPGpRQPT8potrAfBOZ3wAhjlxS+fYGGNgL7TsIc45OaTCY 4Hz6GQ8zXxs1Fj760IR8q5SdIj7rL0bJRdvfSEodd9f3eBC4acsJmddeG20j4o2T+zSO s2EidMdtGzzsApzFHhw02S3CtDNb+ttNyYSLCGnkHrb1hRYCR4O41Qw09+/TIpFFwVlv 09cg== 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=xyp6khKdIkhA5xSLGNeZkhNG4sPGA+gYtVZl2iVCnv8=; b=pENKdvPFv6GfOGP5C7TLc0HgnbOmrzdrGihZUpnB+cNBp1IiBhMAOdP45gVXZh1qIL +TKhTF4DmmaazxIpbejQzJmhT5Lrd667ZbyHvANeXQ2gQ/c7d8UI2q2PPbjhmIXSDDDs ZwiFbOHJSiRMzoT+r3mLpp8DJrCH4mNG/y+R50RM6ZrcOFrBcbL7JqmAKGR80nwj7GpV ioKr1urbZb4L968bxxYp3NoKxf+x2agBMdVqUoFu3+gzNPZxSHMYd613hOCoZKNRDAew AX8MSeAy0DBksl72e3SIJ3rLaXKHIdz99W4+Q/2xJlihRZbXPJVEwFoYh313w9kQIeeX GinQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="TX5bYM/Z"; 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 u4-20020a17090282c400b0019acd30dc69si395798plz.115.2023.03.09.04.52.54; Thu, 09 Mar 2023 04:53:16 -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="TX5bYM/Z"; 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 S230166AbjCIMlT (ORCPT + 99 others); Thu, 9 Mar 2023 07:41:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjCIMlS (ORCPT ); Thu, 9 Mar 2023 07:41:18 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2110.outbound.protection.outlook.com [40.107.117.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BDCE4849; Thu, 9 Mar 2023 04:41:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=odETv7lDPYNueYF0EnAKbcfUQzcYdBA+BccCukEvJ0kBpHOM+d0+t95BMpeee4ssKLNltnTqgRVBVKjghC1/euOrVLTZAsl8Ig38poUh7I5IDKIDtLyisT66wbGUuEZ/v+rHvqzWj6gfq2FfKHlLjhOZxObHqEGuGACs/Luh8XMi+ce4qSp3gmRGgVNUcbcC7xJ1Q8T3ZlHn4HdVdfGcAmjiZQ8Y0UWhO4e9k74KHT+plen4VMi84Go1Jd699AMgtLf7TgjIE7hyDrxCLZWje9/9MM6eZShtwpImu8I/mC/dnWvIpjzUh71tZZzXEN9Ho5glYp8npU4qsLe6OtWxww== 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=xyp6khKdIkhA5xSLGNeZkhNG4sPGA+gYtVZl2iVCnv8=; b=YSqf2sWkvyZFXstIPrZ7IQ35FDo0ZzXBbYbnFbiviS4Lm4krbWsyIM5doOaggz1l3vTkrftYHBrUlNmL/NvPIxNtiS1z3vMAJQBX7jp9jIqHVygvh7OYeSD3Drs/rbCxFidUaiRjcXsmWxunal30cLmO3rU6EOHC5MANxnl52dSfo4osy4THBUXjV3qDQmrsDuJZt6urdxruCimtvGDpjXcpXkbVGLlVFRq4WgBwELkHIu7Ic6wTiq4qnBuCPxsgBlscil0hGoixJtrXUA2U99INjEa1jkDRi5VOS6fMqa7ovatA+9r3WVHqm6u52sSguoCK9nFaS+/X8juTZ/YVRg== 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=xyp6khKdIkhA5xSLGNeZkhNG4sPGA+gYtVZl2iVCnv8=; b=TX5bYM/ZQEqj6ynWAyqFFJLtnxP3cYWT+bvBmtHfmXB/Sa7xlbC0MuCu91miXQfw6o4qoBP7p6owdJSQ84PGuvQMOaa/nMr8891DsEN+ljgGTuFXFPNkuCG8BBdp+xwNYo/lMxEdBgYj1Z2npcv9W7iBeFFArRXh3VIJOJoFa6F3Ddn/DAHLBDAVQtjW0fS/q5QAzGRqs01sEuX/VYy1d485P1CF679jNnMAlbP80ia8DqMfVDP/3si7qLBwEJS1aNrsdeviYA9RR4CrZqe2YBacN5LsnlTae4+qMk1shKUGVkfJfGjfz1V99XM33JuwnGATWqU2Hscx+16hKQyFSA== 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 PUZPR06MB6054.apcprd06.prod.outlook.com (2603:1096:301:104::13) 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 12:41:09 +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 12:41:09 +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 v2 1/5] fs: add i_blockmask() Date: Thu, 9 Mar 2023 20:40:31 +0800 Message-Id: <20230309124035.15820-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR01CA0006.apcprd01.prod.exchangelabs.com (2603:1096:4:191::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|PUZPR06MB6054:EE_ X-MS-Office365-Filtering-Correlation-Id: 6eae045a-6ba2-4a96-7172-08db209b8ee0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6P7++5T/2tqGKxda9iuUKw8ulfTUUCg6+UoNEWVIwNSjwA0epc3XEC1YFz9RLh4sSlWci34CCE1ylqMfd5Wv8cewLK3O8QKpg3kW5xKUQXMIPokQVHmwhHNHSr2FTd8oJZlTHA4M83vAhzNQqPgoaWGvOsTblnNSpDrINP/sRffSMe4YIRvKwJvmq4QA7Ojsd18NLMKh0EoyHenKEVZO7+fY9M+3dMA8N/eH5SJ6ez4opLM+wEHZ3HiJ8YrW5tu+l9THAo95XU6iaof+xB+iYasxA2WAlHAqLdZv/oIP0F2MnpbOg3b4WEwLrE7MzB+t1AaPZUlnSz4Ff0QoKY4UVKKwNfbsAOC0XGEslYUmVWbbbGG0rIY+J7VJszha1uEjcW46BB9B3vLAUYYjDm0KTMXKUkBMkI6X+hNQ+tZpkAU3cJgDuEySrz7tVxJL3ADuNfKSgEjb4vITTzsSsJsZua/RfI4MOTeJxFlLvwU74kkH+D0U6oy8H62p/hMjnpspfGvmZ7H/jRRbAMvNzimghS/GxaI6LqX1l07wsSL98kWSDjbzSXCzxmPP/j6C4XMOooyqar24Ao1WvVzYTd2rAOPn+M4aO0XJQCflH0S/uHl/ZurWDrsZ3s8TKSpWHebHiTFJXLMMBe8hlXl5wGiHn72OEhdia6zM8/l1KBq+YFHUz3oTTlvmYmqVXTfWwnHU0l43U5xYaVO6dbOuoFU1v4WxkthZkhKnfb1cpEo7hbI= 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)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199018)(4744005)(36756003)(5660300002)(7416002)(83380400001)(107886003)(6666004)(26005)(1076003)(6486002)(2616005)(52116002)(6506007)(6512007)(186003)(66476007)(478600001)(921005)(4326008)(8676002)(66946007)(66556008)(8936002)(41300700001)(86362001)(316002)(38350700002)(38100700002)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qwUd1U9/ddEhpB5ym1KhX/c+Jrt5cpwDYPe76437Qh0GFP1W3XGo9N7Jp+7Jz8XOi2+403LUHNwtqmHA5tUEmsJUwMX8yjLSfNGiZ9ao6gbpUf9DUDuO/Sak/AbFXwwhUOhsDO8I4jqj1fCZP1DqR3wtDu9UpNR5G1s31KyhrMIPwW29nXmKCAH5nKSM6ghRhTVuVQ7yjxBN9cApwhcORjiYyPf4A6Wpo09xhSh/+XplQDaX/7lkW5yHD8hxhkSOmwF5z7yJ1ezQ1qpBBuc0vzQkXPDKTdR5RVRuDNnMNSYWe5fMSTXoL2dLZntSxXFVEqsLq6QouBPfO5aVmGf5q04fR6NAoFQbw22WAQuSdPrJep0pLV4TlqV3APbH9MDaAqJmfAfjcIeUF0AKGx5MYUOc94knFjcTbLrRBpY9m6dd33yBblVODvBiCbBGAX2eR1XHVk9pbjtpN/gjulLc8pcaTkt1wmE/IpZ+2lFrR3p7IDLvsfunxeBN/vK5WO3S3NyqaTCKzARPIJ0jMoBQR7dW4BvsXfC6HOtiFthuKBV8dz4tOEOkSH77AnrsXXJxRyyMg4ONhI77vrzbTWGvNni65JYKauIwacNdaMTbNqRb6WX5FLyOfGPBL3zpGny4TffQafW7Xe57vbrRpb7i1egJQBp1cTW286wP92BSDSSES0wBxVK68iQh+TYH2ifhK/jit8D7g3yS+66lqUHPkbtPDE1fTgCrrMqM+baMTeVxmYMFGQE11UU6scs3NiSah49r951GpYqNmNc0dyfQA2gfE/vJFIQOjFuwTm39Ncbtt6GERbDPdlqgrQGk0+eHEiTyGtmiQTXsbVJ0yVU14o/Hlien5AjdK8z/CwsVCyQZ6xWopCfdV9RE1+hYmjCOivcPyZAFmyKj/4KHUJjB74hK2IUKGPIGOYrmdFDLGlb5yaJuC11GwLX0jk6F3YKYO7zxkv3+dyCyvlXg+5y/agU51wKtlGXRmynLz4K9kSxHY/wMhWDS3cn6TkxHoM+D+nwbPwO0YxGSd/9K/WCzeyXoydYcl4zgng8A3VzXpHc6p2Gibw2ZCcvvIgt/EKLXgs08FBrPoKHJ19D4hlk1xe3m6OyvX+A2v4syhmA/MtX3huAZFDluNDEaeJxkaIHS2U0P+1ugrx4EgT9zT38+Dzra5TmMYUEdf26LhM0JqBXABp2j01d8ZWJHUGo2PCqBKt8K5gGVKtOMwF/zgEIKVtzX21w9OLu8Stj1zmUXvWbsIC3N0LyUuInxob1V9ABPenQt7HuKzMUK1Uf6/+mbiFJsF7HzxJcfeV43N+6G3LmwYSZwG+V9X6DAGPYfxWhdfdAHutIeh1ioookV/ax2ITMrUuLlqIQKjIGj4g0g8UePAGa4otn58WXE6XM4uR1A2nbKIpXbWjKbBCr0DT/gSDr5c9NtfvVRF0KJHc5jIQXmpgX0C5pA8dDRQSR5fpolU1uBFKDifIkBuQEtHKG72XbpZD+hGXzIiLhhf85vKsFwgjGDDVObDqYOL1ZFIF6WdnRHzhhWNhmlrm/qkL9t61UiCbrNvqJJgvSEJA+OBOquxBi3z/oSpzkbPsA+rXax X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6eae045a-6ba2-4a96-7172-08db209b8ee0 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 12:41:09.4338 (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: hIwsa5dMsMOPNVWk3UVyOvQAp9MVjcVoSIKUNaLd8ql1Zznrw5khsn1CPeaHJtkuSbq3UFTLetoWINaXLzFwnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6054 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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?1759894722619439796?= X-GMAIL-MSGID: =?utf-8?q?1759894722619439796?= 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 --- 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); From patchwork Thu Mar 9 12:40:32 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: 66834 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp271092wrd; Thu, 9 Mar 2023 04:53:22 -0800 (PST) X-Google-Smtp-Source: AK7set84XZr/TFsftBXAJqCkpVRykVKgD2h7cbAERKD552JQGG25EpSFyzlaH9sbvZbFD0FWB9bu X-Received: by 2002:a17:90a:350:b0:23a:340d:fa49 with SMTP id 16-20020a17090a035000b0023a340dfa49mr6555552pjf.32.1678366402152; Thu, 09 Mar 2023 04:53:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678366402; cv=pass; d=google.com; s=arc-20160816; b=D7+LC83j/tARAbjk6Pwiby5qInwC46b9F0k9PMACNGSJPgPcaCjvMeszHzILH4a5q9 7ZTjD5IVN/A42Cbgx+QLSu6I/6Ogt3fvqxcHZoG9Aqdv7W2MHhCEaYNKfj5FSSNxM7M2 QsNyNedGe/Pm14apUubqi/OWtDFxrWg/fSyylo1QZ/BhQW5gZQhpVRHc6ALATbFTkKEz B1ou1/UU3LMoe0QbWU5/N4LXBfslJDvleVaYMlJHbcrDE5vthlgdS9rOy2oFRC+CdYeU UgGh4MAqB9I3B/6PT0i2dgauQT/NrKf6x+oIJsijzqU3jymWZf7uW/gRkJklJ5kJGQiZ 6bvg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0ZCLfrca9skSYdR8l+HEgclKLc+LoguwesGZMfxz/10=; b=ia3tFnPx+z/muXg0U0BA1t4K4b+FDFF1iUWugQS0wtviIhuqGbSI3xTzmSKkmyIKth N7JojLuQTUJXUlpong8DYAlBcl2OzjbJp8nAD6fpV6ZMsRJwLuH5Y5ZeVvrk7IAek3H4 uemsw/8YjPXnmrmxjDcJ7c8MZvd/FSCt0hnL5f0Ahc3MCtBUiCTGTHiiF0u5mWYh/c5j JCwtPG36a5nfPWj3ydFxTE5kY41DZnTWWQg7qBCzmuwzBUGHsBeWcu0FnYRKwkz8rhFZ E9AsyJeXwZKQ/arZ3Y2hhVfuzm/GRWrJ26ijdk4WV6NcXXv4ahQaVwycKuMdecxJr2Gs Igiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=hyLKniLS; 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 x187-20020a6331c4000000b00502fe0f38f4si17958765pgx.676.2023.03.09.04.53.05; Thu, 09 Mar 2023 04:53:22 -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=hyLKniLS; 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 S229798AbjCIMl3 (ORCPT + 99 others); Thu, 9 Mar 2023 07:41:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbjCIMlV (ORCPT ); Thu, 9 Mar 2023 07:41:21 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2102.outbound.protection.outlook.com [40.107.117.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92882E34BA; Thu, 9 Mar 2023 04:41:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CfoCcPgNyexsoORjyg49muBAy11NYhdoggWYvimjNrDKW7OduxtOPXZ8rQtVdUFF7O0vAhTuc+7npsPk3OWRoMbWkz6r1hDyoU3En44+NPvWQKum8wxIYG9xUCRXgqZq/owlC+dtPqrSe8DJwCN2JbgTwL2AZozY80jHIS93Mhp5C4Hw/GYapP9ixJZQfUT8h5vgsdvpBBcfJe/DlqY0SSazEGBi4Wsf/nDpRq3L6wlHpYthPsv0MEFR1mKEQvv1Uki8x9K2OgvFgpvWLkeqjJNtIHAB7LWNS3QYsCVHaKVxumlj82BP3N4RYp2icnFbVFvBmrlxZpvMlygtB7VoZg== 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=0ZCLfrca9skSYdR8l+HEgclKLc+LoguwesGZMfxz/10=; b=ZRbtAUHM/qA8CT4u7AQ88bJr+zz5FiaTG0Ro2ZDzqDPk2n6mmIkeiJLmZZQ5sD+oaEMmuu6C5MBcK3HzD6ixz2UDfGPHJFXYl1/JbavBS0Uk5FKOtwYr3SGMJSkVbJVaCVPV7pPsL6iHdjAHZ5o8JFJFUtUGfDwcFeuY4pUL2RtOktdFwpQFJTYQqTt5qeMdHFeQEh8dPzyTKm4RTRcn6To99uvHGXBYKzEhfBCdniD5G6gHQbhod9D22BrUP8/yl00H1ZZdZm8ihcOSeXve2si+i2GyCmuU3E4PvANTtD4/1Xkk7zAuvLSmU5SIV/pVG74/TpZigO/DRtfyJttGKQ== 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=0ZCLfrca9skSYdR8l+HEgclKLc+LoguwesGZMfxz/10=; b=hyLKniLS6rTBrNhznzQIPbDC4q67MatosnOOGRKqM7BKkZfQ+OGSmdzG2bY4xdIZ9Pc1CxNOrOR0a0JAi9N0UaT0y61GmF+geV23Ymy8ig1XLAbpn8XTbmk4BBPbIJAC4qO5kFJPSr1mC5sw778+iDn1XfoKLKcOsByQ4aks/9xoZG89OwikGdQd91vISuzlHnsMzFaYvHy4kteW3Z5ocjsJoXE6582F3p2QeTSCmUdcXTubZgh7HKFJz1Xc7tYxGnpc/LL7HvBKNqn4/Ya1QnPjHTm9driimFcK6J7ylUmBbJvp1WD4K85pcxkia+LUkdyAcpnGJ5Gz2+RJaUt18Q== 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 PUZPR06MB6054.apcprd06.prod.outlook.com (2603:1096:301:104::13) 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 12:41:18 +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 12:41:18 +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 v2 2/5] erofs: convert to use i_blockmask() Date: Thu, 9 Mar 2023 20:40:32 +0800 Message-Id: <20230309124035.15820-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230309124035.15820-1-frank.li@vivo.com> References: <20230309124035.15820-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR01CA0006.apcprd01.prod.exchangelabs.com (2603:1096:4:191::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|PUZPR06MB6054:EE_ X-MS-Office365-Filtering-Correlation-Id: a09f7129-6fd4-4738-6fa9-08db209b941a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uOqsWdLTmFre0ldLWcpc4R2o56DkeN59ug2DWaUD/Au9L37DSbR52beOhPm6Nw4Dxb4wPtI/ggiji/8/H+cG4GTWs56N9z3haesOT7gxru3gqn/zFIZ1hSKA9JHgAo2GAtCtBT8pozB6h5kg67BzezK4eobH+BYaIHLzOsFv/10VSLDBH+o3ERIclkfVdjIiO/dOldwPjITSpcKX5JhTjbhp6AX8xiQBelNGrT+IVeWfxNDAxQ/mfdgE1b3mKaltYuUjRlOOpYXgRoYEk1KrzFuUyEDd568XH/zbWMrcsGRF6RQn+k9+31/3ym8IkWZMbOTGlXDQVhHXn5Ac+AfiCAg3p1bduS/KUaUKOCiMihY1f+LhkCmjRVZ4rMIs1uVyx4DLayBg7F7yTiNvzhmBZ3GLwk0ZxFt+y8xd/5QP0T2znm92H6iyU+ZlmX/GM9gLIWxLPo0bd/Y2zNWa69e3nbAtIxVjsRL2hCKi5ZE2CJ7rFzmnZAkERqj/2E9g6MUUTYDDVFqOWwB3IQ2DC6IIogOlJSTudgIJh37SXEBtQcTaELtAEaZ4VuXnGwxfopFo641YrxQQbX0Bk0NUrPpjw4LiYIKf4CPUcFW37ztotNckt4fw05GMPN4tunPr0sBlt+diWbdjWyCi1TMF7WHy1UUYN1TO1d2oMDZiK/YfME/KJoUvb26E7Jicf/Uw107l6NQMP4Tgd1YBTlG3SkMPbqOVkfmBZkXsWJ7YbKRhuDk= 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)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199018)(4744005)(36756003)(5660300002)(7416002)(83380400001)(107886003)(6666004)(26005)(1076003)(6486002)(2616005)(52116002)(6506007)(6512007)(186003)(66476007)(478600001)(921005)(4326008)(8676002)(66946007)(66556008)(8936002)(41300700001)(86362001)(316002)(38350700002)(38100700002)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oqYbHCV5OUKh62SXwdkXr7Q3HdSwdiShQ7hp7AfNvqdsnmFdAjeCYm5aEzNjmaqiD1Ul6sQTc2TDZRVDyElYOsBikoYh0FTsJHIdxr9XmVWgIYcxGS/2ZxfihQd1waeQtLC0tQ2T0cBnzHEQUBsbF48qmgaNuvjTHqk9Xdu5uSR0ao+nLNRPOKD7ZxLIcBWiGlHG0rzcFqTauhdfddnC5ZWdawjTAvS2sjFapCKvSKbryiPufss7ZBBv+mulFoYPz61XYQD3xZO5OdD64wRqdMlNhyppQVD0tyA9oNTuIFKPb7FMBQ7QGXJ65QFRw6hr9Ieyf38ir4dWAQAx+iwjihJhhIagNPGBSbk3+Z1cYjJAHNOGHpi9635YsGv9VV3+0BZgM/vIQ0QZzTbw5rlNEGmWh8NEiCi+JDt4PQowsiZYxhi8WvGTpYcyFSLzeMt6Y+sFIN/QJcKZC9xGHyJciCHA2rshNx0DIWuSkBP9tQVPnSqLhwohL2zj81UDqNFC0XD1L4q+8brzJLfJ5XY3oSeJutRTy+y7YRK9Td3SnUTq6PxkjLP1xfGGKbTGT4fgW2RIN53bd8BE/cj1dl0ccIFchLF6scWMx72lJ5MCCEAkpKkr+mmWjgJtM1tqeSpyjknKvqllmL6KUEm2gADLN4sHXT7s5MclgKNPRrh9DC4prbASuiWQrLrP58FG+qJJfFyRfQCeYzZ0d0+jtqR3feuVR9WSv/0ys1wP6PnoO3M9DpXLCYdpfdkb45WFAvOFJ5JwthjA9a1FDjfa4yCJRu7qYvDCQIt03yaN5OjirdFfSBpZXrIGjClVAT34cjCxCrHIEDsI3FGATfH9DEYoN1lwRG7batwX7GKs75BchSwOPzBu4wv/HKLSh94gVJ39VU4g3A1i5nKGpQa5a2s3AcLeu40G7x/wtJYPdupznRAZMAl9Q5getnHVAcDkzFKa+hg8CC9LjYmPFlTwhZ1nlWFVnrmhTkrKZo2qaumKkDfkDwQ1hSzk2P+BmaQxgxI+Pg0GpRQWjYH5pIf9YRwyyPD8hoXnCfMV1ap8Qto/00k9Tx2I8GYffonBew4SNbhoQygyrIfibUwm4s4B0iIyGBkKnXJ2rYwO3CiN0P7imUoDK4mWmn3ZrwoNpgl781u1QkiigkPaK4ZqzvmZTl0HINRmgtDslfh8f4vee3mUhZS1NFR2Y1RKp79OMTcWUDqOaIy5IQuEaLP3t7YIB1cGMUgNJ3XwFIk8nEHkT7lHd+L5s0r0C9/cfa2Sz7oHQZfXfwcwjYYktI/haja4lXzkTLHfZAA8Iu6QZ1rlRQeYhyOMTEM7YWgeRS5/3UitNKAFxTIDZVj9x3RIajpBMo81niS7bGivTkL9UAKaOO8qPKqwStVihQNZ0acfo9aTX8kQlCv19PgIaYINZCM+iMMrY00+mywMJeJwc8jW4j9eRPybb6pqvsQNOe4aG13wPAEkbky16unEKqoddxWA3RPdVBVls0M+ilReBBEh3/P4Bw7xWsp9S9TZ2fcJa3RBW4+J6DKSpKNm12QDaF48wSTYJMWfV6yYuoA6FMFuCBaZ7ruynVuGOE8YYgepa+J6RV3h X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a09f7129-6fd4-4738-6fa9-08db209b941a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 12:41:18.1849 (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: BUURUGHeQDg11Thh+MoMMKA1ajppisEJBoN7569mUMWPFKwwQp198r0P000kDVVxGbsiosGku2qqbTBFYN1qbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6054 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?1759894728632962213?= X-GMAIL-MSGID: =?utf-8?q?1759894728632962213?= Use i_blockmask() to simplify code. Signed-off-by: Yangtao Li --- v2: -convert to i_blockmask() fs/erofs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 7e8baf56faa5..e9d1869cd4b3 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -380,7 +380,7 @@ static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) if (bdev) blksize_mask = bdev_logical_block_size(bdev) - 1; else - blksize_mask = i_blocksize(inode) - 1; + blksize_mask = i_blockmask(inode); if ((iocb->ki_pos | iov_iter_count(to) | iov_iter_alignment(to)) & blksize_mask) From patchwork Thu Mar 9 12:40:33 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: 66835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp271388wrd; Thu, 9 Mar 2023 04:54:07 -0800 (PST) X-Google-Smtp-Source: AK7set9D5YDLDNO/TSgLT8GoViUfWtukxzJTLeT3FE/Y8hs8Pgomze6Mr1SlREkaAG/XTt04Ai+U X-Received: by 2002:a17:90b:3142:b0:236:7270:ddbf with SMTP id ip2-20020a17090b314200b002367270ddbfmr23900828pjb.21.1678366446789; Thu, 09 Mar 2023 04:54:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678366446; cv=pass; d=google.com; s=arc-20160816; b=EZFPDwd+RgvJWfv2evI9WL9QVxEnhYFVD+Da9scMXnGRMy28G5VIldFztZhMYKPYN6 oGGzSvVcFlga7P+VViJ3ruo/btnFG79WOstAYygv5lHO6fLZtIqGyDtVJ8kjmFnkwOCZ 6yQmEdUgIRCd1EbfNKo3qFRzeoYDQeZDQy0q0W+bHBMHG3u5I8k9AgI41diwq/pzhhUA Ha1LZ+BsHlShM9a5pwrN2SupaQDWAJtYSMfswnKws+Z+CFlSxUjhdelnnDcheLkZb14M k8nvwuL7fWVwuORB+5lUVeNWRa817pNbPYjuTTmsfxs4iaBSMA9IMDN6Ltu6NdAOcibg 1FVg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2Z7X19ELXxbAoyy0SRQNbX79+Ll785DAlNhB1quh3gM=; b=JokmCYzePREJyS4vqQbMwGEiXMDq4l+RZfP9PbZ+6gVY9+uBH4smG9XpCnlNstAnFO Odid9OVRnFIhP7YB+n5K56uHTrfsXhiTGAKxPUpUut0v0hHzQi7V7LdcN5KH51PCjLPF 0rxr2EyYJ8d/9/XOG43qaMN4I9LhETQzkc76NQkNyBLmhUi4n8YRWVEugykBIghceq1g 9PTH9TpAhYFoySWC5z6lveg2s5HMHgwT+C9gBaieV1aqRLu4Mqbadq/L8FQnwTEd4y2w Fsr9/mP8n3A8o/Czcf/aPsiE0oYzeurEAdtxo4nQHwNjyTRHobrMxvEl7l26U7NLb0R6 JDHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=SnhJGLxF; 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 w8-20020a63f508000000b00502e29be692si2395864pgh.289.2023.03.09.04.53.51; Thu, 09 Mar 2023 04:54:06 -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=SnhJGLxF; 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 S230290AbjCIMlu (ORCPT + 99 others); Thu, 9 Mar 2023 07:41:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjCIMlo (ORCPT ); Thu, 9 Mar 2023 07:41:44 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2129.outbound.protection.outlook.com [40.107.215.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E822EDB7B; Thu, 9 Mar 2023 04:41:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HS0jPPtC2MNIaXPnMOFiHSlfsglqEwsefJSwoHoHG4DWfERutRnlRrYhf6Cs94qFhb2Pgelmp7FNvmoK99iRrKzRzc/JZc5OYcffJ5jcUji9L5dDVSDgsNGDUwqqX5kq2JtqvrmglybanjgTNw+cM3a9q4zXiz//l1ZzbyfNGFyW5wjy3gWDFwL14Ap7MJcaK40PT4T3lNe+MWou/9RrGAvMqrZxIZ+3+owfpgzr8R4FJxygKy9avAaeEdphs1wtJ7elBSDVRExmrTJZvzvp7xT6KxcEWfSXdoUYu0ziR83zC8CB/Z7Xebt5QfyZWYHpvuccSqqkH46T5U8+rT/APQ== 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=2Z7X19ELXxbAoyy0SRQNbX79+Ll785DAlNhB1quh3gM=; b=EJ3lsYjFpyjy9CY7wnmtrJ/tnMcpZQORhFcqe3eHV18s9t8ZPRBIBkYDEGp7E1OAQ2Nwgf1j1LPdUMbiM7UD1Ap2FUTwZ5XfrItfdJtCROzGPfxQvRRW2p9Vk2kjnQYLTY3U/VydoPROS8BOWKpsl/Jy+4sOcX+xTZ+5qmTfPkWo1czqSLB8JRDQWRsQQ7tXitxnWSVWBhyjvDyhQzRigVwReIk/HOqy6m8YjL1nodj73toWacIrECuP6B1AGNnPxro5n2nInXkayJfPuDphXyc1FNc8LVa6w0yXrs6mIBz9Ypm3TT8qQ1Zckb967TYZcmW6xSz5cffjGudWKXS0gw== 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=2Z7X19ELXxbAoyy0SRQNbX79+Ll785DAlNhB1quh3gM=; b=SnhJGLxFtCPjfixZcRmm/jyGrKC6ORp/INWYhRQvXkTBAK/Xpl8S5R3A6dD+KOVjSh2811cwTkkmMZb/RO0ykoffVRmicb9ZduBpvWX0OCrnLPGoCbDiN8nY+pXS3JjjgyXzZU3gt8qr7NM2j/34ONpmd4ZzpXF7qQ2a6DasPPD0lvv7Acn9OdktsbhCtHn+T5QDNOsQ/+ojeVQMFM1izTFYZ8CfO3b9PnUMmh6fzz+5LwUE1kCtaTJUcoXBEgDQa/QpsywI0Ronf/kkB7bVXq5qpL7Zf9gUF56LTcR7BJ67jtAI7F7FWXfRIy/8sVGVdyif9cTjHMZqCWNb6vXQMA== 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 KL1PR06MB6259.apcprd06.prod.outlook.com (2603:1096:820:d9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 12:41:30 +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 12:41:29 +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 v2 3/5] gfs2: convert to use i_blockmask() Date: Thu, 9 Mar 2023 20:40:33 +0800 Message-Id: <20230309124035.15820-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230309124035.15820-1-frank.li@vivo.com> References: <20230309124035.15820-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR01CA0006.apcprd01.prod.exchangelabs.com (2603:1096:4:191::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR06MB6259:EE_ X-MS-Office365-Filtering-Correlation-Id: a2f2f4c0-3ffa-4533-c8d5-08db209b9ab9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2bmxk9LMJ19LLxjIK7Gnr090TyGqOW7U46Y/tZmZifSSDSW4RNf7aH6rgN4EnpgSJisoOTOoMkHVafZqTDlU8msIpBXMFbpDS+jsKa2P/edT7j9ria3jhO4dZjRk9VDF3zUprP1PHXFdsgP7PrEJ+MD8YRd2o4o7AEE+Jv5IFdX2QFQcrb3A/vZUPDLO6uiVlkgrGePjb/hc98LZ91n/uyKEFWKMG/NIlPm0cl3yvZroDVUiPPapwGquGRtBUeXJkIKnfFWwvitViCbNqua219Ok7OQUcrhiJ4EVVS7PLzWus7RLImno8GKn7MzRnp1vFs8Wb82X2if5oeRFiRrnoQ4k+wzePOpPu4IG4BUmLq5VaRHwsZ4jo1DSw6F5FiqDhg2TBtPNXufABq0JWDfpVTmpZF0OamnKVjc1RcvZ64wpRIz+xkjsFwekkBCqDEM89q1mF8B46EjvcsglqLQONx3ST1U0Kz5ozBzCpmX0TehZhIwCdlD7WpoSnNQ69stjjsERCZkKz4x4l/UV4/7cFBtJ2J2RC3H6WaEncMp5RdY/tKlJcoLxsLwVVENBASGxBHOk6O27xspHAwW8BmckSC5X7h9O5dZpM+XEuXLue4QEw/2MeSBaare4aHlBpPdJSgZ6KYpR+96juFg08d6KZeXYMcXwNoms2dzsQi5tZ/+M7Wm9TY57ie6Y01kzqakxME4mgN9ZyJpWrBYCpQxgUslXk9SQXKWJ2E4+pjfILdY= 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)(346002)(136003)(39860400002)(376002)(396003)(366004)(451199018)(36756003)(186003)(38350700002)(38100700002)(86362001)(1076003)(6512007)(6506007)(26005)(83380400001)(6666004)(921005)(2616005)(316002)(5660300002)(52116002)(7416002)(478600001)(6486002)(107886003)(4326008)(41300700001)(2906002)(8936002)(66946007)(4744005)(66556008)(8676002)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ozMcl8yJ2xNy0sbfFZEJjzTtGv0fuq5gde9UNKZIflRh20tKbOCtIEfA6u2j6xEh1rsLzoxZiOlrae5NEFxbXRrbB4sVIU7u9w7Pue5sdBpugpvtQbEeLHQw9rxl7wIJYGvAYM41hMK2EguFseEiUy3kIQd4jDLtARIj4u6z8rqviGd6iK99qFlzObrLU3RbZiEiB6hPZ5v/2NLt2H5ZV0izdnnEO0H7POFE3ua9h1huC/pH6D4lPySMBYlFSog52QAQJx5eVrIubh4lxmQfL34LPHZdbX9nWRKMc8QTkmc6WOko8rs0fnAZ1hX9l91uDFBJjXiqyKK7Rjh3pUxrOyXu0Ejs/xxcfduLNJPVqjA+QKMWWDvbLlUDNZVSqXw03ANqQ6TiQ2HEQTQ+Px8XPn9VNuK1YzQ9+BUKTIyG49/kC0KJmADeO9Q0wRfuRZxAwqfrRjKP9HlScCZer28w5Z2R9CUYdl2OD40+9ksnDsYBpXxfs+ovp95dyReb07QjzLN5XPzCexuQqFHMuAm0Y0jIa+SKOn3bf0tTNgEKPmQcg97sE5VyAwG3CK/qVilKulok8NsehLOIvni+F1UgSHy21bQD3aVz0THMrw6kI9kjCt8JNJY8zv+kWO14L/m1ILWoWxIt6sv0SI0ajG/6uDUOq7zsNaa5OCgqHgdtcbK+2Gu/DTjrJPbmCgXueddi+V1V1hQpc4BI3RXEhDJRXrWEOfp3pagdAxgtecAUlRDtUdfhev14SOK5DmXz6DLH0KhiSnI5Mml9skc8UxnO0QNV7KrW03xfzxCczoutI8Vdl8qF1oy64OYLGKzvdjc9c7pbvPHTKHf11b4UjgQ5P5DIqtlalZ1F9qn1vatS1LFMoUZk0YbdbpWt8dyuYY8udB3PDGbMbY//St7Ev7VQuEKgnZhcYp8KWWXEiwPGGu1RAv9SAjmHL+kZQRfkX/xOgJ64HfGoe8TFVFL7QdX04guA4wTMJ7VBVy/6x2uXZJbCkbdN6/6IcGgi0FvahdF8v5/nVybMe8I8a+WyyYyc8A4ycL9fzRXq0mkpxslYwagp07Px2GVfSu6FiVSj3ukrDuxu+g2nyi1bTan67R7Pw+9vBu2KtuUB77O1R7j0xor3UB/9XVSyg4RzLXarC4x4oBe/6nrebkNRN9C+rDnLYq5ofVEcZ7wyYr7wnbBeEJ5w8V0F+kBPQqVAJJKeUBHa/oeZ5VBplGvooL4NCxbpoH6gymzpDgBCf4kw5x0U96XLczaOpJtQ/3C40T98atC5s8Ymoku8tYh7Ies4qCUkrrBNW1/iNKlrrGYDT1SGCnhw3cXbyaToLVyDFK29GUf2hOCEbIZjoZ1mIwoAKC5QGe0RIGzSMTGocmgEvJ4ps05YRnLJttZ5AxPaWUh+J7FBgvHnUy8RbenUqdStZ5XCQ6p4oVPMuZiXmQf1svO+YRjuSuqUJI6nGVhXSgkA3n1qaQ+pyCsVhMNYO6NRlCK0OBiu7i6WSQ3UpBhxqDvF5iXX9pd4gpTsU1aI6IlrmWrEx1cD5ATexwmnZRwqxXg/Yo2tGxB8ZP0DgK6ZGhcgBJ9She1hyPHnSO7RJeyTfenE X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2f2f4c0-3ffa-4533-c8d5-08db209b9ab9 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 12:41:29.3130 (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: /VHGA17u1WDd0a0giZZqm7Sr2Ozv/qboL9WeHNxlJ9yk5qFcTq6iwG1GG/IDREqnaydWCJMDjt9u6XAJY6z1IQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6259 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?1759894775354071511?= X-GMAIL-MSGID: =?utf-8?q?1759894775354071511?= Use i_blockmask() to simplify code. Signed-off-by: Yangtao Li --- v2: -convert to i_blockmask() fs/gfs2/bmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index eedf6926c652..1c6874b3851a 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -960,7 +960,7 @@ static struct folio * gfs2_iomap_get_folio(struct iomap_iter *iter, loff_t pos, unsigned len) { struct inode *inode = iter->inode; - unsigned int blockmask = i_blocksize(inode) - 1; + unsigned int blockmask = i_blockmask(inode); struct gfs2_sbd *sdp = GFS2_SB(inode); unsigned int blocks; struct folio *folio; From patchwork Thu Mar 9 12:40:34 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: 66844 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp284675wrd; Thu, 9 Mar 2023 05:19:54 -0800 (PST) X-Google-Smtp-Source: AK7set8ljdfUbxO61o5CU3iKZ9wqqDp7FsZ6jE2d5XvOp+g0++fqjQd+CWF3FDFi0enGPF4Jlp1V X-Received: by 2002:a05:6a20:258a:b0:cb:7958:7071 with SMTP id k10-20020a056a20258a00b000cb79587071mr25422837pzd.19.1678367993778; Thu, 09 Mar 2023 05:19:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678367993; cv=pass; d=google.com; s=arc-20160816; b=fm8yvPe4aFuvwBipjZKZU5y+P6ltZj7OMjyoyDqFSTQYNiI4GmIbW5o5yzalPrOyXd 0yvS1OFnZ/iCQky+6CQODJEKZvfp6iEi2Af3N7kj02pkwFnGwBEV6q8sCk3VcEebCscW rsnvQSyxEoWIPXpk200TNhhSF0bNj33s7Acvy8wakJSUH0O4ZJeBf2PN4s4uSVgg/SXK V+LBZ+Js6BIxsNIpqeCiCrZy7m7ULj5L3IQxJIV8CDzG8iYF+KSxp4nrmoc3y/5hXeoU oYDJz5F5ZH6T3Y2XQ6KF86Q7nuFavkN4C0ox0GF+oprFMENiqaq+Btn18sXuBpw9YN0X hXrw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=meK3eJWZv3zCgZpfoN2XpmXl+kR+wlAHWD36VfQ5CfE=; b=hX0XWp5NuFFOmmrk1HgQCxxZRewezYiembRnpYDEFASjxNMiqX0xXof8S8IiCVEajN jgxdJWRpCH+QXn1qBeUokE4aPhlYzvpY4TpzE6b6kSowfZMCbVpqg8nLis7Bs1xIEW2u n88THsnuk6lyKib8Odb4tp64e6g7avDOQ0EcEFNjUw8sPvlTPSaTtQaERm/6gXh+mJPe BKZWnG3CWFJJ3TuCtW4mFdBIG4iP/nHs83hfZoPbDbAfKD0ag7PnLlq/ySOipbCRTsTo APaB/gnyyNtdS4o6LhDsDzTlFdmhlGJZGciwZzRjQMQ/SPyOs2X9YIF631SM4xER12+B zCvQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=hbuJDvum; 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 i5-20020aa796e5000000b005a8d43a7e6dsi17480542pfq.112.2023.03.09.05.19.35; Thu, 09 Mar 2023 05:19:53 -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=hbuJDvum; 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 S230367AbjCIMmG (ORCPT + 99 others); Thu, 9 Mar 2023 07:42:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbjCIMly (ORCPT ); Thu, 9 Mar 2023 07:41:54 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2129.outbound.protection.outlook.com [40.107.215.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 917E3EE29B; Thu, 9 Mar 2023 04:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OFyQMCpvCjwpcH7Xhmc/CCrU/Wp/qpLeZb/GB/mLlrNkemJkxfQsdH0XoWkHxwNNw2bwE15f1It99Eebow29i6hXrb+CG/0qRg+wkeg5w6M6+OcRIFywkCY/8FZzK5mS1o2HawkQljlvYXujKe3LFGk/8mYXfqQyFJwH7pRbF7KM2RIPpvXTiphT2WEeex8jJaDPldz8BiyQ0oHDIwxFXSXIuaap3jpsW75VWNNUxJhVn2ep1Go1Jh7uNIqUsEL8B+M13zsQaoD3ijIDiUm46cPtYHKqUYt4F4OLo2eAQFzqAatn4ycLUpdkFwAlS2Emwtu5lojASGfA/OUVUniP5Q== 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=meK3eJWZv3zCgZpfoN2XpmXl+kR+wlAHWD36VfQ5CfE=; b=bOzbuU/h6YA5gFpxMp7vdOR7JC2M+lw9SSX0w9HQvXeiI5J2eT/MieLYXRLOuN+7q217IDSL5tdx5zgB7jRoN27fh1JRNNQXL8JRbRLpQmWVqrP4+OrK1CaUL2KsTut9AgubJEBYN9gU/k/diSjJ/uXQ7FSxVrsrME9LllvoUntzOwCdcMbnN1SH+T1I6/hj3g0FMtV4Mbe0lRfYWFX9IShKk1HinTvKAsdqNvtRVJl/0nJK+9LuMhwZkqRpFBL8nt/11Ndij4sq3suXEqMFtNq5VzdU0MpEUVjM6bYgjzxKTlMx8MsbGEAiPIDNp12IfYwr32R0o3RvXQTsmmCQyg== 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=meK3eJWZv3zCgZpfoN2XpmXl+kR+wlAHWD36VfQ5CfE=; b=hbuJDvumQukOVUFj7PR3cO6foLEEqTlEy4wFo+7H1+GCF5Bj7qbBhr7EgXFkh52+Nlf37UdMaOlgZGocoFYWxVQaWhup4o118UdPmL4ejfsFbak2ZJ2zRwQjNT+C5Yxn7H+abYsYAPHCZNTkg5M0Fr6FD7az9+u0Z1XuSvEps8vj1v8CEgKhwqQFzD2AkUwwlrKOx9d0Euih/8gYh6sacTikQGMZy+4FLXLiwJvqTf8SMX31oH/QS3ZONhuyydBrHmbR0KsUR914QHygTS59KjnEnfZ6FZj9HXMgR6Kav1U9KiUInuJbEDloeP8Jv++cf28PjPK2OnDW+HT/bkLLMA== 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 KL1PR06MB6259.apcprd06.prod.outlook.com (2603:1096:820:d9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 12:41:37 +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 12:41:37 +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 v2 4/5] ext4: convert to use i_blockmask() Date: Thu, 9 Mar 2023 20:40:34 +0800 Message-Id: <20230309124035.15820-4-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230309124035.15820-1-frank.li@vivo.com> References: <20230309124035.15820-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR01CA0006.apcprd01.prod.exchangelabs.com (2603:1096:4:191::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR06MB6259:EE_ X-MS-Office365-Filtering-Correlation-Id: f57bed93-7152-467c-dc4b-08db209b9fbc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E28tnN0AujbpmRZCk6r838sx8XzdR4QOnZsbXrmykSp75UD0A/y6Xm5/d1Ij6fV5gqqK1fM5Ekm8uo4q9tyermXalqW8exywaZz9u84vs7iCAzxGkSyj9PtnlY2cUDRFyFf0hIUI72uhsAM4dZU0+svfl0xLcAyEkWF8WRH7n8igQD6+1HQELI7qKJSK6YnXKhLvlMEofu8hvRAQ4hy04oKbyrz/13Vymu57P9Ug7wZCdkaBWJTgAIZ8HNtDWFyFEDQiAtTJH2icaH57ug9SjLUALU0QoHPT835TGfBqFLVTZGynRgLgA69eSIwby3BRHljMFP4Mbq8GDQ0Ofa40kx88YKyDRS9ZUeiPwCrLkqia07KxJvBBGcmJ/xpZj7kbBaDoOv4FCJ+N+GyG0VUp1Y1AHT7NgWzwAP95LfiV/ye9dZwA/tdM1UDPmm3BiXR073VQpy1vQcn3us6VcFIZm5r1SiK461i1Aj3lShlFlcg1UqxSC2NPd23+FhS8g1R6k5KMyt2v7Cr0voq2BMgFjZBhr+fI0WbotS1JzEmM6urQMgV25THqSRF5u+XkSKvzW7Rsv9WPTFqmBpBeBcAwM1IKmUaz07UWa9ODGif03lnzt1Fw9P8yNM3q5UEKAo401R1egvamSqc3mdR/OpbuhZaCkTsJwcAmEhG2/an81pmQ0VfvGBudEB1htMym3VEJr/3vlvsE4eeAWGD4C3cntAXt96KoIZucnq7+mXXEa7M= 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)(346002)(136003)(39860400002)(376002)(396003)(366004)(451199018)(36756003)(186003)(38350700002)(38100700002)(86362001)(1076003)(6512007)(6506007)(26005)(83380400001)(6666004)(921005)(2616005)(316002)(5660300002)(52116002)(7416002)(478600001)(6486002)(107886003)(4326008)(41300700001)(2906002)(8936002)(66946007)(4744005)(66556008)(8676002)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZgLxxfX4t1McWSOmo8olL9zhL7a+yo63tKZgLEGPM+bFjj1dBBDPgqMRTNYrBdNh+bcEBs60dG1kBA1T8LqDM2DBpmriz8QVdQ8I5YRldTo/o0LA4YmRFQIEwCXmlTxZ9T1VixePb+TUTweGwczPXYu6Nclr35lrviR4qPBrR5+9jqNCK3i4dJ65DOgTl5UpWXZnOKz2IAUOFJ+zFjsIujWf0QJkwI6PrC6AlYUbwISfAwHCqv1Kug2wkxDx+gQbGlmTaNXf13ctN1hy9cVeWJCmfibRdWOXtd7hlqmRvxqbGCf8Rg1aOtowXDdD6hXEyBd4UtAF4EnC5Wc5uBeJkUckL7B4wmqlrdxpTtHuwXhbnLUXEF+VZ0wxfL34qbS1hglNwPC3BCoUfCV8lS3hTMQV2keqty2HWZF6uKKTJ4lqYMfWycqedrniZA8JcqMAWz0WTOl6/SAPlpk+zUqVfSjyCf2MSax2GRHX+GHdeh+FShO6d/BOdSyp/+IRpMACzUHjwaof9itmgu+f2mSOWkRqmocJtjxDGwZCmJIa9aqU+Z6lKd2xF91EMuSorqtUNRedXaF/LK7ALBGPWtAi3BLPh+lkurzDb0WUQDgRqnysv5d/COtRXH05I3mM66bozQLd1mXkXoFYC7U5AIMjexs/wgEBcf6dJI6PZ1WoDqR+0sWa5ywRiqnsW3gpKNARmaRrm4406eKYqBRXS77jqkPxhCbv7hA5j6Pql8fD9kK24AgBpkLqKcaHPK5UxSrXhEg6P5qQLwWvYjgcYGzuAKbTl3BiBVMZQf8zOdMcpaccIlxzTDZoXw9P38m0p9X1Z9oukxmW9M2l8RkIJWhi513JMNzHLQJHYNPohSqZ5jRc2xXGKranwyox7Lzuo1yip4NXZwPVxEQTJMxTDETm3Cbl3jubdEuUPrqUtqayzUrbPf2x9Mjh2elkySCbw1W+6SDF8HHE4DDj5rolI3PVZSZWRidhigHkDXhSfPAaLY6kxnNv4H61bNASph4iDMVn2VzhIkWX5UmYrh2KZ5UdKic1EHB5I4Wpnc24yahLnC9lcwqii790St9vdihSvgB7cq8I3T636aCs4nLu5qveMGVPoiffRqhCeb2slcz9rrxMZCJfmLr8SoFdCPQlH4Gpc7hjQzxqsMtPRpY/unsSgY05CLAaSbwoUql6sY2qi7xerVnzJ+CVfv0nLJGPOvNcGLYaDlcK2+rgzc+TAY2Uc0nIiDyTSwVUwRF7DxB4sLmgGDDZuM+U8VZDMhE7+B+0Pz/lKF3vb/10W9h+7lh78fxVUZsKr35Hro9vcoC7oFLLXiuIUKdLS9kPIsgCsQbjGDvksOX439gN7RNXRsoalHG4mo90TeSjY0ipNOslqK3EeE1XK4NeHXtMcBUV+Yn30bgkYAUbmh0BRAyQ5V+Wcu01YEa4e+mz/xC7dvzkBbTYyMGnVzWcYSHuHEsyfTERq8r1jky+K/eokdE3nU9CZvzqa/AKYigYmMsAhbEipJNkqVjr6NCFBV0YIiIey43i4gSFjSAfuv+c+73bFArtWwhQLIYXU3Gvwf5DzvbRR13H1DRwVgktRb/byIy68c6l X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f57bed93-7152-467c-dc4b-08db209b9fbc X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 12:41:37.6749 (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: +dlKu3pch/ixyeDj8WZgn90xdOKVnn/PxaOGafWNX4R/lfto4+glIrZ4a8O+iuorfDlSeTgLt506p+3lDGMYdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6259 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?1759896397400113752?= X-GMAIL-MSGID: =?utf-8?q?1759896397400113752?= Use i_blockmask() to simplify code. Signed-off-by: Yangtao Li --- v2: -convert to i_blockmask() fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index d251d705c276..eec36520e5e9 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2218,7 +2218,7 @@ static int mpage_process_page_bufs(struct mpage_da_data *mpd, { struct inode *inode = mpd->inode; int err; - ext4_lblk_t blocks = (i_size_read(inode) + i_blocksize(inode) - 1) + ext4_lblk_t blocks = (i_size_read(inode) + i_blockmask(inode)) >> inode->i_blkbits; if (ext4_verity_in_progress(inode)) From patchwork Thu Mar 9 12:40:35 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: 66836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp271426wrd; Thu, 9 Mar 2023 04:54:13 -0800 (PST) X-Google-Smtp-Source: AK7set+DPUl89waMNwJ8eyRI1mRDN27PoeSPgyayTaSfVpgTDep0Z4olAWYpWTh0RXuOg6J/4FmU X-Received: by 2002:a17:902:cece:b0:196:63d0:a674 with SMTP id d14-20020a170902cece00b0019663d0a674mr25681527plg.9.1678366453184; Thu, 09 Mar 2023 04:54:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678366453; cv=pass; d=google.com; s=arc-20160816; b=PYkTBgguQj/rRxsnOGs4m/urF8q1rUfO17cOsOlbCAasox0kYXeqSYDMVoQkrKBAjt sfxZnaD2ijlBT/WOmbE3XzejM33fPUUFmKGA+NPOaD5+0SqW9CC1mh48REcyIBAcYnOl 7o/K7RKT9cuh+6vcve2C1DTwapCgOlPvhEZDcugaFNq6/63qsjfu6RMlNaB4UPt66pfP d32apMen0Rj3eSmJqOxxl7o2IQo9MaYOOHLOLfFIkv6mDVR+wOFBIF+uLRv6nXIPzcF5 lLIc3VynDpbnTP0wspxTp28oqFSeI1Ma+elzdyrIn8Jxyt16NnwmNLUcq2jNDE+c1pZ+ kz5Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LlDfmkV9Ah+i9b+mzgZJx9kWyxH4piNrBP9agZqeWwg=; b=pyfbTBMO50YTtbjmMuPaTQvfIyETSGxxnUSarex8bVnt8JEbURGiJqSMwURWkhCi2i oOYaaCunAvCQn/KKxrjD6/rW1TgPA2OEmvI4oOrR0t1+ufxwloWvdllUcvD04koUbIPs Q+rV+EPc+6xnSeVquB1/qif7w7coYiXMgBTJ5vud5ZQ+L4zF2qDXVw6LxFCVURHIKanx GMg8DcXIwSvrfCGz1ECTBQpWpOZEc2jKQ7MvS1NGJZarhUVG6FogRuRRPQC5i2x7lcJp nXbbn+yYmRbk9KmqzrKfCqw7KOAnNsWpzepbc3Hs6nWx3Olxl8nIzwlX4a+k70GidlSC K9xA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=SKFhkUKX; 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 p16-20020a170902ebd000b0019a86f57ef4si15795162plg.176.2023.03.09.04.53.57; Thu, 09 Mar 2023 04:54:13 -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=SKFhkUKX; 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 S230375AbjCIMm0 (ORCPT + 99 others); Thu, 9 Mar 2023 07:42:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230398AbjCIMmK (ORCPT ); Thu, 9 Mar 2023 07:42:10 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2129.outbound.protection.outlook.com [40.107.215.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55DB9EDB5D; Thu, 9 Mar 2023 04:41:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+aDgfiCOEJwtPdr/RurbHwiaSsy59hTzpptbbgkSbtTQUnTKi9KffeHS+6lNocTyuv8XsXHpMg3KNaoPCQ++/MqY7QapNyVVPgX2Hd1fQGbmPw5ngC4+PpL5v7AvJCIlArB4C+vYa58Z/00NKE4xQsaKoxJDVynY7H/+KXkeQB1of32m18e5Ia7khOgg7eznGIPQhuVXRcHWhDk/SfbAsMzS1TzGPVPqbGN703gi6lyS/4jnsum7b2GXTQtZ6dRpMUmgUs3mLJIWecJbfOnp2e+DXzUA6OXG/pOhXj5zTFTKwemuXDEveqLedV9LFhpB4YZIY+EoNM2oZTey9x0KA== 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=LlDfmkV9Ah+i9b+mzgZJx9kWyxH4piNrBP9agZqeWwg=; b=iLuOhdhFMKbm4suS8hDY9CIbEj5qxqfnUDHQPDp9GxfRKGlOy3CF8tpJOenghgbdU3baCmz7wDFqb9Iqtu6pRs95hHHLRYfkdbQWN0dzI6IWR/x1YrCn2eq2SegQp8T9VwF/5WbcK3OnxdOfDMaM2uf4zClTw+sNPR/QSdTeB4NQNTiPh9u9ZXdt9WKM3TpoITR4VISd0NzTaFqOcfG73wTkQlW6K7rsY25VkJ50x1t8GcnHtQNdwy4ymLqdSy5juRX4J7fAiV+6NQPpUWn8y4iuvmeZkyThLLjxf0FQ4wO0YyPO/pafkBqFhax+2dZRYEtcasZb0uVCy4mwNGIgJQ== 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=LlDfmkV9Ah+i9b+mzgZJx9kWyxH4piNrBP9agZqeWwg=; b=SKFhkUKXZ88tt6swle/RzEOj+xytwYgsbXV3BfV8nioLgqYFYvHnpxhRZ/++53pGldB5rXLN3yylSw5vD5LeY5IaMVN53fRgDDbdACpYutMyD5KcZkqWDirQ7vorKeoBrlovogvxp5vjv88SEJN64SOY8pyUa8XtWNxaYEDNBSpX8yO46qQqMncxrA3KmlX3wv34moaxB93tXSulh5tiQFSjmsntmRXIBNpo7mwbm+AzcLzjUYq+FVJIUFO4iZ55T6F9RWm+yxDjZlvYsHeJHJQqjEKNp73AEUpTHPMdjI9vhxPQ4lXmCFy/i1aLbUetDmqVnSVMnRkcQOTJRomP7w== 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 KL1PR06MB6259.apcprd06.prod.outlook.com (2603:1096:820:d9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 12:41:45 +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 12:41:45 +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 v2 5/5] ocfs2: convert to use i_blockmask() Date: Thu, 9 Mar 2023 20:40:35 +0800 Message-Id: <20230309124035.15820-5-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230309124035.15820-1-frank.li@vivo.com> References: <20230309124035.15820-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR01CA0006.apcprd01.prod.exchangelabs.com (2603:1096:4:191::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR06MB6259:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bdc6c20-59a4-497f-eb99-08db209ba468 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /9VgcMIo2XZSLx9n+63QodaSkZMcfSnK1zAiby6GGlf5cz9awbp+rj8OcpKLKq+bM3lYB48C2b4K/HSi1v1/VmZetp2vDydqNEZjtcq3L138BczYXPandBWcDb6aM3YtrV+atL9US08QWvFmCLaV+Q9YO4oKVMgcvP1WTmNuAec2//G3fYl8daQ9QFzEd2EgkvkjMGRaDQ+1MDbutBeR03AgjAhwgDiU7fduiaCo5KA0u/jysw5cQ2WX4WvyK1U8FpcjDngkKj/0p9rkT5ob1n4uNoKMfUkYKiwaqwK7ikWKsMcz3l1/kRRRsXnIJoN6JVsRad5mh1SI7phpkXLkDU5YzYvirboie1nqBFe33udS73tPPSoatipJNOuCadDmmefqfCPVDi0xr4Jliice6j+Vu5wq682msJFawltFzoWpOGMruYN4Yb5ibzNh5hom1hhZlenSArcVQVgD48wzELO7TE0JRC7b4J4+GgTsxxCx3Ont+Aau82GUbHUvoeu8AjW557OGM+jNUDwVvWn6T78I+7dbR555BlnAAR6QI9VEaDRnwsRsSfhi4eCCrmevcBb0/MPLz2CFCZF8Wtku87H9S7GfIaMRbFjWjARblMPsndqCaGOo7TL2HN5rCmJrcSE6jBqUw5lF82b/OiXr+BSwZ+jRSTizmO5VK8s7GPAOJDAUkdade2GA0arR2TD6IKGj1nd8TBsC7LL18c+CWzAibiHi6prbyzMPneeF0KM= 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)(346002)(136003)(39860400002)(376002)(396003)(366004)(451199018)(36756003)(186003)(38350700002)(38100700002)(86362001)(1076003)(6512007)(6506007)(26005)(83380400001)(6666004)(921005)(2616005)(316002)(5660300002)(52116002)(7416002)(478600001)(6486002)(107886003)(4326008)(41300700001)(2906002)(8936002)(66946007)(4744005)(66556008)(8676002)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1J/QAn3VEwBO+3y1Jyd7huHzVmxpdJVLFGT0EC3kXaMX9gclQxiqvd3E9gV5dPGM2hNGBRHR5fcviZ/u6awpK71ddv86TjKp5ApHjP/Q8UYZaUcGm3XVcKX5a4UR8QWaMXikNymgUm4hZ3ajnookOA+ZcemVbAF3aZJqamwNhj9QaF7m61sSZZHOqCmSJddYuasY3hC5st1t4mzmD34bUwtLR8rq8i27kkVqrLWTuR/Ty2rENsiYryjCxVwLZMZSKAu6CUgIurdG2uVejI7PvcDAPPVDKDBg8ZoGDyWcI4y+3Jh96ROgxLMrcFxuvQqlizB4WolEeSa5YCYyrJesSMBHz68pQfDbhXvu+t1TEAKkzKPNxahctrsfrm2MkwapXXJzW/KuRf92/SkP2sltepl+mdacjdD4s6OuKNhei5ADvq+a5+k28TcEplp8fX60rmkTinLf28ryYETuB5v6bLNsL4VVo+egroGlVt1KkYN/1pZqML8AS7+yLtVurHOnt6HCD3TtLLO1nKpTI+CKRrkZj4kVCJl6jDFrnbbGWxbJciFDZyyJJqKonOiBrjsWszEXJUtlSg7lqm1FaMifv+ZqB868t1y0+TdFUxepHf19/3OcPyneP3G28dZvwVO/sydeR4MjQQGpcJsKZAfYjuwDNOIqHzN/Q87zgqaaElaZE4PVHf1FVngo9jhIZJtOOaJAi1pU38f6Ur7KcQHM5D6jQxn+PKpuYNXoPK23jHzwkIvooLMukwOZtgp9xyJ/BEwZPJyk6xaVPyJKLD/Z0hWf+BD4TUZxqspf704kYP1VL7bowWZtyT6dhnOrZX4s7Wd2dzGPW9S16gTVuXryCcs1tWbRXtxaeTZJlfFNJskJZVwKVglz0XwubuJF5jghf+sZDzMd+XpZZ1N7LofcY9PO2yaQVJjPe9HTA189o/P/+nMjAoQYmFF7RXTr6tXjUfmcv6OCNix6R9oA8uuxX7NloIyA9KZ/x5XFGZ9OQWe0q7IenXvNvMu2Uh54I6y2598dqTjp6oY2So5X16ETT7BPn4dEt/375hlmGdlrAcSubOIAEL+U0G3Kq6IUd3OVB5UFYudx5jI9rdGQuSmMRFIgrOsMG4CKibMOsPqM+Vuxtik3SfeIfUoJZIom9+KL+qbV8VsI5rGwhv5M/G1zagM1l4378RvqHNOvjH3BRi5As5rHb9yejqc9+PCK3CPIPpHDqAm3LkPKqF7DRjR1M6MiLzlI/CiMhYcocylW5BPS4C/47wt7RO+4pl4p+FUL/3hgrhiKeJO5rwOcMLIw32YU4fArEw6VlWzemN/vIB8UR7b1bxNL6huaL74HhKxPWhPIR/n2VM556DF4MEA8ayd7CKBv2zXg0UAJZ1mE5QN2W8Red4zUmy5hkopf81jtKMV3PCZAdx5QHsq60q/hW6ZsiQfblIopkyjbBHli6MXNGd0ON5ydfTnFmb7CNAPdvrOpnuY7QzEGo6NbDRDbWId7Ie3spladYM6IJpn12JWQX+fFPfcXqXiIot3qKDzlBYNaXbe5+Eq/Mwk5mM5blgn60y0srKHwWGYPWphx3nd4mx+Z53HmFlNHYXKRl7H9 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bdc6c20-59a4-497f-eb99-08db209ba468 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 12:41:45.5447 (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: 069NZGzxhTPlg+X44XPS7qEWqIOlrvYZxF66H4bSU/VtWXymK9WtKd/hbTJLhLBwfdmQYZEIXtmcU5ae+DyFDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6259 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?1759894781606747527?= X-GMAIL-MSGID: =?utf-8?q?1759894781606747527?= Use i_blockmask() to simplify code. BTW convert ocfs2_is_io_unaligned to return bool type. Signed-off-by: Yangtao Li --- fs/ocfs2/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index efb09de4343d..baefab3b12c9 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2159,14 +2159,14 @@ int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos, return ret; } -static int ocfs2_is_io_unaligned(struct inode *inode, size_t count, loff_t pos) +static bool ocfs2_is_io_unaligned(struct inode *inode, size_t count, loff_t pos) { - int blockmask = inode->i_sb->s_blocksize - 1; + int blockmask = i_blockmask(inode); loff_t final_size = pos + count; if ((pos & blockmask) || (final_size & blockmask)) - return 1; - return 0; + return true; + return false; } static int ocfs2_inode_lock_for_extent_tree(struct inode *inode,