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/Ty2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6huaL74HhKxPWhPIR/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,