From patchwork Wed Jun 28 09:34:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13295453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BFD4C001B3 for ; Wed, 28 Jun 2023 09:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231405AbjF1JsX (ORCPT ); Wed, 28 Jun 2023 05:48:23 -0400 Received: from mail-sgaapc01on2132.outbound.protection.outlook.com ([40.107.215.132]:35171 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235611AbjF1JfX (ORCPT ); Wed, 28 Jun 2023 05:35:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FihmbyJ447UudSt4IqGYfK3PAjBxiPCAzZtt/PHxzhrFnQUC/zbwWNspaX4UhrCfWJOVGGh31J/gMuwuu98fle4dMmdqJTZIQCggqeXXUOXmd7zRLFYdg8l4fmItAogvO9kidHDvEGMk7WcADjAH4MXqLT+D5Ufcoz9lGVoRmszb6LGqZ6Tn9mkvNJy5YBHf8PssHfOJxqMYu0CS9gK3/VkkWVFweORctJpGQAQ6Ldji9RxIU45UnDbhPDGa0JJcF1kvH7+RzlhqKda/efCL5aHx+tmzHnCsKgEVuGgOvmiEYwhKVTPzYcjzAu5tMj3YiJm75sdOsfZJq1H0VNW7nQ== 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=pSkxOAJdOVpvqaie33NOoEzGy7YAHeasGwTqp/veHZw=; b=X3tsk6u9INgaIgcjdOO8RENYQ0BpyDTF0PTFxjXsIj3mGrfMohsn/tYF0Mx8K0Rmc4Y6RncKfX2K0uKAqZzZgbah2Z2GZOCmfk/eiomGgQ85MsjiSRHYOQ1WtlOzXfZ0AABP7qQQZD1oml/7IQvUdCWQb8ZVIpxOm5QuKty6GVcP7H2RPJxHwCxH2mt/krxgHv4sLfbW8QGTNgAbavOMuM9jwQG4gSG/mc/BgDecqMMAGG6PixzOG7LASIdyR91+rr4RIBOWHCYDSYJbs0cQxTWuHpR7Tr6JhVz+cLWx2zJJyIYtXaGjJuLLlASzWOnXH8tVH0VCO9hykJFeyrbVOg== 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=pSkxOAJdOVpvqaie33NOoEzGy7YAHeasGwTqp/veHZw=; b=L6AZ07aa93uJqLyI/1wKgAubeBSqpn2wo1ZrU6y5gMc7QI5+ytkqCt0CbQK5OSKXZtoCUE9J1M90IfMWRwYQth9GyZlX4LLIw3VuuW2KeGhuyjhq8BCwLA1s4Az5gJykUsLdYMJ+XLVLbCi2HLVUDzM65X3F1N0GX3syR4gXEbp7OssqMsXQAhDkrC0xukP6QS5HrNAsi3EaYiMyKLtqnQEcAjFqdTbN4v8EPK5jWnEKillxaiCrOpBOKZOZ0sGR0N16TZajeGGgV9fdPoBva+rvrVJ1BAe2jZ3GNomfb0XRR6gfhytRRyQqBKdhH/++Pot3thru+fdBlPTTRi7Nqw== 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 TYZPR06MB6144.apcprd06.prod.outlook.com (2603:1096:400:341::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 09:35:16 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 09:35:16 +0000 From: Yangtao Li To: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org, Yangtao Li Subject: [PATCH 1/7] block: add queue_logical_block_mask() and bdev_logical_block_mask() Date: Wed, 28 Jun 2023 17:34:54 +0800 Message-Id: <20230628093500.68779-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6144:EE_ X-MS-Office365-Filtering-Correlation-Id: 46d1fe1b-14d9-47e4-8732-08db77bafa0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6WJnUJhgtFz1cQAx6KimKdsVgQAul6MWPn8FMkG7/atdPgSj/vvac4W5rxg+iQngOUhvzmY1KtmVcaFefX76kcnDBpw1N3sJ2bW1nShRDVG6+gYlldytiWOvWggEESmQo77Yg87nZW9g6TJaxldwgGLxJTN1Fcqkj/iga/iNl4xaYvNVWfSeuuiqOPglv9zzCz/ad/S2029igzgi+BIZFfm8ASJOeFTTb//SmLJkivcrV5kuznaN9UMhlXfUQk9v9CkXoFGTEVZAwnwDMthmMjF830Xpos0oDtvsLc8RmhnqJzmj4c0onz46hMSsZv2lYqDE2Jo6uhEairF2PodZAWOTgVCN2yDFbeeGPtvl/WLvMwZyzoxoSbHilXvTVIfvvct8F6Cgr2xkYSi0s/fkDg8M9LQY6NiZzC2hnXDZ4pOY2qyDns1SpuEBmrVQoHMGRztbIo6CfBWiLhjDqv3sz55HOvkH82noICcIpEonSkWyyI33Lvgr0mEOiUgRHz1pcbiSkFPjCqTdAQDibqccmd5Hcahcm/2f6MeengiQP1xfxPFbANp6jZUPsd3W2dKUyhMawlWcllckd4qQLuxrMgV8TbbONkFeyyjhkl4HMuGE6YTVW2RlH7sf024t9NL2jg/SWR9hAOq7YFgzhuwFvA== 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:(13230028)(4636009)(396003)(346002)(39850400004)(376002)(366004)(136003)(451199021)(1076003)(6506007)(7416002)(5660300002)(66556008)(316002)(66946007)(36756003)(478600001)(4326008)(66476007)(8676002)(8936002)(86362001)(2906002)(6512007)(26005)(41300700001)(6666004)(6486002)(52116002)(186003)(107886003)(38350700002)(38100700002)(921005)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Fop9vj2S4TkPyc51TwtDcXQqV58t1rxqS3TJgL3iujulKptyoKVRreF3KejSyMPI2fp50p4DZnQo27J5wWp+4X7GsWepfvVisDSt0ZzoiHWFXFwHdOZ9Aw8tMf44a0qJHsPfah6UX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Q0Bgp2P4xYtjcF4SutF05Qaa7Jli5PkvumKXQfmI+kyTMMnmrhsB31KK2oNVKdLLTCsABpZvc7rgFDNG928h7nv2Jsz0SPowGM68uYEn7Y+XhtKfvIXPTesbdh2vjtwLFydKYL1ryukTMvsQXjrWP3qEk7koSb8r0zFeFqcttdKP66zIb7hSSqDbWGziVIZpiJtqcM7GLBGJnctPZa/S+zoFLow1PKe3gvCZ0bIyLCh04y3OQZZOTOifUuF3xCDogGRSZ2Fmb4PokVzbTKt8PJD1NUzz77rO896OIsokdZTMqmj06g8m1Vmd2PR3rd50DGk5LdTs2ohE1XEp7NrJ97eeeAk+01R79wbI3WGe2NryFdHnta7FooZ0o4pJ+1GqCA7e X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46d1fe1b-14d9-47e4-8732-08db77bafa0c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 09:35:15.6511 (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: 0gvVjgag0e6ZHoovRVcPOUPSffQpa07qYtUQkKaP95a/P6axewaW4czLSmACfPE2Ac4W2pH9K05EfWwTVtsrsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6144 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Introduce queue_logical_block_mask() and bdev_logical_block_mask() to simplify code, which replace (queue_logical_block_size(q) - 1) and (bdev_logical_block_size(bdev) - 1). Signed-off-by: Yangtao Li Reviewed-by: Bill O'Donnell --- include/linux/blkdev.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ed44a997f629..0cc0d1694ef6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1150,11 +1150,21 @@ static inline unsigned queue_logical_block_size(const struct request_queue *q) return retval; } +static inline unsigned int queue_logical_block_mask(const struct request_queue *q) +{ + return queue_logical_block_size(q) - 1; +} + static inline unsigned int bdev_logical_block_size(struct block_device *bdev) { return queue_logical_block_size(bdev_get_queue(bdev)); } +static inline unsigned int bdev_logical_block_mask(struct block_device *bdev) +{ + return bdev_logical_block_size(bdev) - 1; +} + static inline unsigned int queue_physical_block_size(const struct request_queue *q) { return q->limits.physical_block_size; From patchwork Wed Jun 28 09:34:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13295457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B46AC04FE2 for ; Wed, 28 Jun 2023 09:48:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231974AbjF1Jse (ORCPT ); Wed, 28 Jun 2023 05:48:34 -0400 Received: from mail-sgaapc01on2097.outbound.protection.outlook.com ([40.107.215.97]:47553 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235662AbjF1Jfk (ORCPT ); Wed, 28 Jun 2023 05:35:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c0y6kFIhIcWYv5KcUiPNVIiaOzk2Nsu/Pf+bnHdlVMnqPFT4GPJGRWxERhpIL7yts7DAApbB96tarUuCZ1dsO19GSe4z5x8pYa2/91ZNtnwywehkaoSEYkTyXd5JPH2w0jtnIRhgLZYGedkrURhYil4nJE+Bkwd33WOilnsAjYMfbPfOBQ4CcdkpFwUgr0tdgLAQ5DWMaRBbg+1fEUH8ivrQndcdl41pjqqNcbYn7AliJUEVn0MQcKVEj1kOLRZaAva5TDrhFtFwOSwzNXyNvp3h4JW9nU/1AxHS5HZ8Y2wuFJ6nwrBWY3g8OI/K7f7hG8xe+h4B/zUoAKNPFSVD3w== 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=DAXnQAczusqQD6IX453zsmGlIdP7yO+3BQ6K7S4HAdk=; b=MBYIxaUlti3HkU7NywauTf23JqFqSWMPKmgTW9KBzX1PNEtMjQAmi+ZJf6dE071htUXQlzwEhy9VesOwMWtisg9Jwv5XwUHKwpzsi5JDL2H4ejj1nn8pbM1zJjy0bMKmNRJOdHoJCjiT7BqBEvGHtUp/cWyJiSTqVLBBUU99mMv1itwB1ns5AdwWghHAwtZuubCBfDh1gqb/6MXB+N32V2anOIg4Kq/+DeJFWTLHqrAnJK/IxHbBkXJuHSRFTW/XNMRWN4fIBDVMoYZZwO1RBjysnzBDPKO29VyprVewPISWsDWSOexLFqNxgaYCYKaAbLK7rBGUEgUzHcF9qvLXcg== 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=DAXnQAczusqQD6IX453zsmGlIdP7yO+3BQ6K7S4HAdk=; b=hPgYK3gEi72nO5gxKRgqZ5AOn10g6ckS3Sc5S6BCheUsxGD/mMUWlauDz82lXEMBN6aAiGwjj8FLsm9OWdZicRaHI9AXiMnV2FORDqYUqKME6q6M6XnBLhH7Rq4HM4zQ5NQss5yHcfd+50BlvgsVb7Qz6PXDPvC3VSPNxWugfE/OoGhbNxhC+7Qv6QUlcqIVLlB+Dv/y4oUBaKlwZ73zInoyOcs1GeEXJA65hYxillbdVUv3IWs6r1qJ5kTtH7qKsLko83kFTrABQoeM1E+bmKBz5UhvR06J80bamZ67OKSkZUPpcb8luXOjUajJh4L3Ca50A0TliE55yYIKA5kYtQ== 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 TYZPR06MB6144.apcprd06.prod.outlook.com (2603:1096:400:341::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 09:35:20 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 09:35:19 +0000 From: Yangtao Li To: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org, Yangtao Li Subject: [PATCH 2/7] block: Convert to bdev_logical_block_mask() Date: Wed, 28 Jun 2023 17:34:55 +0800 Message-Id: <20230628093500.68779-2-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230628093500.68779-1-frank.li@vivo.com> References: <20230628093500.68779-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6144:EE_ X-MS-Office365-Filtering-Correlation-Id: b8ebca12-19e3-4b8c-1727-08db77bafd0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c8JeDrbwj/iD6gZ9uhJicEO/1bI+s5MotfSEub/PXuXSlsF+FVeklD7eIYcdkWz1ETg+0KNzroAyBZM07IKeLoPy46SeDByEIcnRb0kcavsyKPuoQ7Vz9vpMfpUsfm9GW0DIs4t/m6DQ00Tsr4dc2tvQuvnFi4ne28K4J9lbh/dHmq6GBRu9FbWsWMIBA6TlXBSqOerEm2yh7mmCELxHYHK/zc1J1TRBsyGeAxOu4M/n0z5uYG6VBbiQDl6K6BLreoyLRllzz+tWXV8/E5IspjdZm1Xc1EpPCgGfoy6AXFjhFPQKH8H96s4hqlpy0rO22ZUunYbSRr5qpwmnodIpUZEwSDhTZ8a5fSffN7EExo+YOpw9LCMV18sijCz7NNHcmCJsft95Ao88MbWpQuHOG/kTzQOdhWRF8178e74m/IhDgN8WnTlHAzXGZ3ToY1hyP0XNvZTJra76/Up+s5QjQ+EqhGfNDM12y/TGm3gZqk8fvgRUbt47e/x3xDKz9Ug/oM+zrwlfOHs/PtmD/VvaMekYH73OtIpdMIc0ubZuFPk4yECRiGGMsx/SyQysKwzG/FU/m/DzxxHT3q8WydsGsxdLq7YyyChMR9KbW6fRMlHglu5n9mqgKH+z20OPtY4BxY0rQRO8XNk3BlC4KKdHHA== 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:(13230028)(4636009)(396003)(346002)(39850400004)(376002)(366004)(136003)(451199021)(1076003)(6506007)(7416002)(5660300002)(66556008)(316002)(66946007)(36756003)(478600001)(4326008)(66476007)(8676002)(8936002)(86362001)(2906002)(6512007)(26005)(41300700001)(6666004)(6486002)(52116002)(186003)(107886003)(38350700002)(38100700002)(921005)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LX0sWQpVDDcvDQ1V+VKVSfRkSpklBxl4Qy9rv1z+InZuf10Koh8Rvz/6pfixR+1/KA90x75LfYU6/1c6ey/A4Y++lXjOkfT2yhOHpNTrBtySGFXY1lNo34d3ZiCUboVWzXNaaoasq+RG+2PFcVllvtFFLYuFVPtEUjv8kLR3paX6DQ/mI7fzceSZa+r3xZjNcDfa9QiogDaphjgK26rTDMuw2/5SrhDo754+F1QDnWy5q4qBCs9u9NgD0MfsSkZ9pnWyLSUV14dSEmQuIDPj9XI5Q7app3CHEBelNaBnFGL30OJKaxrfTnFVLM8t4dSYfvzMEbozITfSPwzTFk4e7VedhM7aWoHCHNZaY58Km2U7rlafL3DzgcK5NUUG636CTUUf1XZasOQHn98jyT6tar/ZNxBUY7e5W4+mxoGgMjWchEXREz+wPZK2F02OGV13xVBwFWWvzsuACoOEtXmWK+vrHYUVjS1ji/x3ul7EauHN45vkKm1j8uMFcMG8QU8tyxrQF2HiW4oCuErXrEkPaMZEQbqeO4cTbfvd/+KaiMYvnu8Tqvrkdc58TJLnkapWpr8z/VN25YwP4s625ztMb43vFijV4/WI9+qWPf3ZDIUvgG0podw1ZtdnAf2MRj4ZzhHtSXd6d9+RCPBOkHMU6Py2OktnYKPLKpphrJPCUObfHEWnrffV4If1AmRWNUjYzrc5eHj443EzzmJ6dRcxWcPiVTwkYek0Ai3+Lph+G3jVqiHSN6CKVlayZf9/a8D61eS/WXmmM+TSjFcVKZkdS+pC5rn5EHPA3eceYre+gbsQTMpIUvpatkpd6rBDm7u8JFU5zPNbsK4DDhMT8ZHNfk729v3rPMnNgfMXfNBGTdysoMApRDmCMIhDW2nv8RBzXb/ovfwtd4Yts+A5qXs2+FASZgKaocpSwn1N9x8TNDROc//sBUt63Kthn+oTSexEPwJtEV+8UURCHXiQXaFzuSdmSwaBGN0i4ZGo0OJmAa//B6/v/1Icel2qlGDersCvzV0eaPbSDN8f4Nmdlha1saQwGhL/nQsGjLUCSWu1aVABgtclzYWji47T3Kgs27xIGJ7P1ducKG0Ev4tjN/wmOXM7ZyuPvtvnGSsKAYQcmIlZLn1riBBV1VF0h26+MIKYpLn+yV6DJMJoooOa4ZNxk1o+hvRNQVwYsf1fsmImVhDhiGNgcXVJxMJTiSjKodt9iOGvMN/dm9LDnA26wbftueDfRWj3/H5MbATHBCtMrwV2Og1JzChfkYgYFp491GW3dCQg/oxUQE7VoMz0WnmtB1Tt5cbC23fW9qF1IlUAlxwK6iYAUnJzEX+YT4tQvN6puGKlik1Lkux1WBsWwjLjZPSO6dQcB9+hoP7meIATPjJjceKhUD+mN+okPpWbW9yuqGVjpibMya9kR06v27Z3f+bioKECV5ktx7UdIVhhAwM81W85HTsdVuskiYF0m1jIqsgbakFp126u3GfkzAf3XrLxpAMHhRI85ZdBprH/gCkW6dQyuH39MJF/tAlo4rALuD0lDtk2Ilvv/ELHeKevjdHPQuYfwUNtIlT8pOPA9GtIMGcI2vustM0qcTMKptLO X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8ebca12-19e3-4b8c-1727-08db77bafd0c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 09:35:19.9035 (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: q0O99hSNbjJW7oxyNZLmkbD4JyNKH8VKsKtKgMGnsMCiTAx31woXz6m1NvqIlke/V5neWq2uO5BwFDsPIEuBKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6144 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use bdev_logical_block_mask() to simplify code. Signed-off-by: Yangtao Li --- block/bio.c | 2 +- block/fops.c | 4 ++-- block/ioctl.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/bio.c b/block/bio.c index 8672179213b9..42ccf5a21696 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1281,7 +1281,7 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) nr_pages = DIV_ROUND_UP(offset + size, PAGE_SIZE); - trim = size & (bdev_logical_block_size(bio->bi_bdev) - 1); + trim = size & bdev_logical_block_mask(bio->bi_bdev); iov_iter_revert(iter, trim); size -= trim; diff --git a/block/fops.c b/block/fops.c index a286bf3325c5..754f7014172a 100644 --- a/block/fops.c +++ b/block/fops.c @@ -45,7 +45,7 @@ static blk_opf_t dio_bio_write_op(struct kiocb *iocb) static bool blkdev_dio_unaligned(struct block_device *bdev, loff_t pos, struct iov_iter *iter) { - return pos & (bdev_logical_block_size(bdev) - 1) || + return pos & bdev_logical_block_mask(bdev) || !bdev_iter_is_aligned(bdev, iter); } @@ -653,7 +653,7 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start, /* * Don't allow IO that isn't aligned to logical block size. */ - if ((start | len) & (bdev_logical_block_size(bdev) - 1)) + if ((start | len) & bdev_logical_block_mask(bdev)) return -EINVAL; filemap_invalidate_lock(inode->i_mapping); diff --git a/block/ioctl.c b/block/ioctl.c index 3be11941fb2d..8544702d6263 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -39,7 +39,7 @@ static int blkpg_do_ioctl(struct block_device *bdev, switch (op) { case BLKPG_ADD_PARTITION: /* check if partition is aligned to blocksize */ - if (p.start & (bdev_logical_block_size(bdev) - 1)) + if (p.start & bdev_logical_block_mask(bdev)) return -EINVAL; return bdev_add_partition(disk, p.pno, start, length); case BLKPG_RESIZE_PARTITION: From patchwork Wed Jun 28 09:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13295452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D70F9EB64DD for ; Wed, 28 Jun 2023 09:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbjF1JsV (ORCPT ); Wed, 28 Jun 2023 05:48:21 -0400 Received: from mail-tyzapc01on2119.outbound.protection.outlook.com ([40.107.117.119]:38454 "EHLO APC01-TYZ-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235748AbjF1JgK (ORCPT ); Wed, 28 Jun 2023 05:36:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZQHFd+OoQA7c5uIodhzwXqZQVExQRmB/45fPfFwOvHKJBywE2yM0RMTkcaRvNYGccXcE64fGJyjYc79uozKAtI9VrgFaoX+XfT1VMIrWnAlybxzg2nx8IWSo1KKUiLhe6tedC8trV2BWBc0Tcj5J7I1C2ZFYwBG4zB5bwNv3vldnMC1CIj+Ejvy4uCWdRTUDLxcVeA+Sx9CjjwPlVzHemoFpPdpkM0yp4RfZXkUrNiAXE5u3yjBq2ykepSfqImRkGKVMBYn1kEczKl83ZOTwT7vIEvqzctJHreigTgVfVVt+EEQfpEmOdejg8IgQ/vaQ9qfmw5zsZT+oFGbHRIyP9Q== 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=RevQJUfiyRbn8eEH1zSheGovhyYz11yL9wYLmwRTbhY=; b=PHJk0hiXs0z96DEd/+dz1aOAx4hVL1BIbbevIfuWDG3ZBQtDc+MEMtML7GFW128nR63L3wpY1pd2m6wWoHHppRYqxomp21Yo25Avvbwvw342Zw2XEzlrGCgG+tcA2/JLJKwigc5xMhizSyriMQRcsKsEnt86xRh6FNLRNZLPf/8y+d+biTgAEIMSZ8d30pKMKjRzioR3sl0s5xbHhRarBB5vcrGBDUYlL8bpjkex/y70cFodmD3W29JDTuY+yb5JShkaajDD8eJzCBGFrG+1Dh2KeEuspFWr4nidVUulTk/3K+QBDL4UmW/ZDjXRB3Dv/bajIrD2n2owD9SKbK6oMQ== 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=RevQJUfiyRbn8eEH1zSheGovhyYz11yL9wYLmwRTbhY=; b=FZprmZAFsn8WOc8jIedFlyqRL8yZqM8Q1Noq94x9UraWhLSjqqkR01Vhg3ja6vWa8iwo8Bj1G2eHiIwymKTkNTrXgnKFvBOB0q5FLQ1sm190gut2uV8Mi5yWUG6I6ImO0kpcEn8ZmnSc7lbdqEbhKz8ONBOz8OtPxBhwGg0TUJaE73m1AZwTBl43PAHIZBNGH3TKuQi8q9GktJDwFcuKHbzPHD+W0l/GuaXCMQO2kfql3r4mVRsZK4U2yaeE+fRCZArawe/rVa1r8L56p2CxFVIZH3hwdx7C5owZhK96kmRv2MmTJc2oIeZ/0xJ1DVzw0lXr7JQg+YRP26GIeCieDQ== 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 TYZPR06MB6144.apcprd06.prod.outlook.com (2603:1096:400:341::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 09:35:24 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 09:35:23 +0000 From: Yangtao Li To: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org, Yangtao Li Subject: [PATCH 3/7] md: Convert to queue_logical_block_mask() Date: Wed, 28 Jun 2023 17:34:56 +0800 Message-Id: <20230628093500.68779-3-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230628093500.68779-1-frank.li@vivo.com> References: <20230628093500.68779-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6144:EE_ X-MS-Office365-Filtering-Correlation-Id: b086d052-bdd6-4a8b-1816-08db77baff73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4+TeHtcBaelEJ1Ujg1nLtFTFkN8iIDVKgNBYzVsvEdIZYSuCLGXx1fc0kFXfudo4YV6PJm+sdpLCwG7vWMRV6Sx2kpT8Ws1Dv5tWNs8dhftktwiEqDmQSwurhPmLB7RefCts3pWTFuqWh5v8CO7T4Pol/7y4zkTu3zd5rJxMjXQu5EfAGuJEerr6u/aIvelW2R2qpQXDV5BFe87LAONBWjvuEaOkhU+/YJDlOfD6zTy79cn99j1O+skhHynr0Qt03N5XcOupJcM1abKiQB/MoZ+vZC6iBaotw/mlVSrer8WeTcRTjdhRkUoQrGS0anwOohJ76qsXDPFHMnqRkG+OJal4FobSWeocT/rDjYGq8XZqdQEI4RTNUG4TAnYQTnvneqhpXHvVUkBjEpyaq7wu6lYfRwtfPqvlo/svmQ8yV1zdXp9LZJGS9ogbY7nbOU1B2tF92ViLK924IUkaa6s82B5kxHpy3fiYxm5Jf1XWmO1GE8fh26wuQJimMUK8ivSP78ghrZvtP/zrRUBsHRIpgPwAeGUoX1E76MFj+ENyYMHChX0CdFKtPXscrBgME+nqMDGQD6T2bJ2Mg+LQlWEDE6iBCXlGwYmGfxJOYSUjEHwj27oSJAm4dUwuMbHVNRINKlj0Lfx4AMJqU2XSohrwMQ== 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:(13230028)(4636009)(396003)(346002)(39850400004)(376002)(366004)(136003)(451199021)(1076003)(6506007)(7416002)(5660300002)(66556008)(316002)(66946007)(36756003)(478600001)(4326008)(66476007)(8676002)(8936002)(86362001)(2906002)(6512007)(26005)(41300700001)(6666004)(6486002)(52116002)(186003)(107886003)(38350700002)(38100700002)(921005)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-M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HySLA3KfNwB3m+hWoNOyjPWiHWij+jdA+aUjNNyY+F3BxLDJB8oPGRLA46y1+24tADYHB8pGVJkCt11noohEQyILY0wgy9u5wHPU+c0CN6pbPayIYjvhkl5xq6VTJSUzFLGvqnHpPcyd/QxKha76D2WNLhQXGxfxwXtuhHlbQTovhnU3dWHcEfWjNjDWrMjKsnWSgak7rG9OL1v1sYlBXCm1ASrMevGZNtvJmkmcgo/qi2vbuzrD1YxtaOK5gtFbAX/6BSHtWPRBrrh+Ic+Js61cqlYwXrQCO8wbiI7g/AXajpXYVOFd+6hu5XXmS+/8nyJs6KbCkjd5sdC+OwL60AYNjAtl2653G+Zd8uHcnIbEwGOWGtUE9qvPntSnUXa1rrvwBIhiBqTyQXOOhBVyTlpXsHKkkz25+CBbSXznT9AvIYwaaJOopfv6GqYvYgnIRCDkHDOPmdDmjsRL7i50MksJlAI/OUsriCFAYGR/jS9IUS+SIyy2N8JRskocQ6SYd4D9fZW/wzKr0oDzX7tyzfS6LFCaCOW99hAqtaXZPoMjFnFqlPWpABrJXRto X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b086d052-bdd6-4a8b-1816-08db77baff73 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 09:35:23.8529 (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: fijrr8w34IvV2VgqLajcnIebXYMsMjFJ/xtol2EGGjr9av/BUgkFrCmpdms5OS2khZcYtVQRqVONCBFUXGvcmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6144 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use queue_logical_block_mask() to simplify code. Signed-off-by: Yangtao Li --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 2e38ef421d69..fd646e5ed082 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1649,7 +1649,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ atomic_set(&rdev->corrected_errors, le32_to_cpu(sb->cnt_corrected_read)); rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256; - bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1; + bmask = queue_logical_block_mask(rdev->bdev->bd_disk->queue); if (rdev->sb_size & bmask) rdev->sb_size = (rdev->sb_size | bmask) + 1; @@ -2062,7 +2062,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev) int bmask; sb->max_dev = cpu_to_le32(max_dev); rdev->sb_size = max_dev * 2 + 256; - bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1; + bmask = queue_logical_block_mask(rdev->bdev->bd_disk->queue); if (rdev->sb_size & bmask) rdev->sb_size = (rdev->sb_size | bmask) + 1; } else From patchwork Wed Jun 28 09:34:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13295454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E8EFC001E0 for ; Wed, 28 Jun 2023 09:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231893AbjF1Js1 (ORCPT ); Wed, 28 Jun 2023 05:48:27 -0400 Received: from mail-sgaapc01on2133.outbound.protection.outlook.com ([40.107.215.133]:11872 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235873AbjF1Jgk (ORCPT ); Wed, 28 Jun 2023 05:36:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LwtAFrZzc76Kwz/zjT3x/ke4LMCMq2H2zyDvFQHP7ww2GPgL+vKVWAQX+dbtZ3H+M8G8pXSJR/CfFk3DLZD+DumRHh+bK89P1Pd8nn64Z4jZ8252kclmb8QOAePggBsUgNGXe9KjGm6e5uQ07hrxqywFsm76f/gZVYnV+ZhQkmDBcbm7xqcjUjK++f0pJEfLDN5n1Pbhi3QiXC4dMsP4EYwPBC01GBAvK9/qQ9EUmHeT8tn4n/lHMlYLvy8kaF52YSH+un0wN+t0fcNAZ71fbecWPUF2d9n6/qaoM3HNu7NYf/mOsgS8ymNanSmqnQsKfXbKjgVvG+QfLo+e6iEdUQ== 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=/wkj8xNo0+zs83L68WDjAFXJ8Wv4XjEBJ8XBECZe66s=; b=bT01KhzX4UO9cd3emsWzIDYiVO0iqS24smfk9HEyMrde+CcVXuo/aFcJPwX+d684rdvCyjxBgIMZn3s7j+2mwB4mT/8zVe2YayWW31x6FcNXYSBN0ZdFwdV/+VkHir0+cuhHuip0H7jOrZhZdTnk81M8o1bXLfbl863+vbsqZvxp2/qrItz0D019F02jAX682KBFre27EG+KpBgulzdyUvBpQxNGjJN+fmUyqC21r5It39oGuHfxNL+sV3by+XAaSHXY01QdzICE3sVfBwe8kT2D1cGS8FzhYC0pwC3uFY96l7nhukZLFo1ga8XIfHpmgDEvIKtDA7c/KwaOUqvjhw== 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=/wkj8xNo0+zs83L68WDjAFXJ8Wv4XjEBJ8XBECZe66s=; b=ZpxPVAXRd9KbvjmyvxIBRANTQpFo2RN+M6l2Ite0/lH3/7FR/A+F5W9kP7/3R3K6NHmBhe9pH95mvY3D0v4oM9mZPKXhrCA82pdnxS/JPeh6W+aMW8z07yufrz/9h+sVcSIBzFhFuBcsHJES/T60F7di8t6zeEJlyAXAjDGw6NT698Bb10GDvHXCLpHE9UIeVwJFnbucw6VdAAQQJYHWHnR2aGEHWz4hqo0Cm6kemuC7lCq/X9nWoXyzIGVzgHcAxBSDwRfd8Sj2MwAHT4/PcKCjMUEztLmV0PZiNAUtSKCa77NUu1PZfHgFKPOolU09JhFj9mkckVuPR1I9w8LxZg== 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 TYZPR06MB6144.apcprd06.prod.outlook.com (2603:1096:400:341::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 09:35:27 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 09:35:27 +0000 From: Yangtao Li To: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org, Yangtao Li Subject: [PATCH 4/7] buffer: Convert to bdev_logical_block_mask() Date: Wed, 28 Jun 2023 17:34:57 +0800 Message-Id: <20230628093500.68779-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230628093500.68779-1-frank.li@vivo.com> References: <20230628093500.68779-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6144:EE_ X-MS-Office365-Filtering-Correlation-Id: ad21436a-a05b-48f0-39a2-08db77bb0152 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /YmnjOmc/PZCBmVPMSA50k1YMnct/HnfZ/UkiP95crG72+t2IMAuMaR4UO1SEKKapZb4tJM2iN2HUz2lpnLv0FH3+3/VRnwJueCAvjgbYaBBYhNgkN3D77ULU/4QsjhqhjdPUyp6+c2SnKcPVTdNFmmCgbkozcOG0l0MGBe4fgcxA4PPpnofsaJrVzsIiwJecRq2ju6qaqMDo6zkFpULoRKzxzfSMuzpv67TUKSJ4mFYFmwd+rrsaB73ovpkppyEDasjJkxYNrSsEWierzZvOFMtcoag5e9OaSy0nv9PVFheX04Tjh9V5I9O60GqaxIKBC3/qhRTY3lfwGu9V9nKe8U7iGYVCKfbMfXVvhZMnrO3dvuSRAdGzrh6IGnBAH/paaqIss8TCDaRGYYUa0RRu7cC8MC2oxGu4qYHWcCmQWkX7XiJuZN3CmRGTc5u2Orts/qf9BbVTeuE8L1l5MVhSOv8BDAWJUDGOH7z+zd7JF/N+oukfdxdwi3hkT0sSyX6pK/tAPVtAjRyC6ed96O8QiTMMI+0N753+E7bflYxlloYMtLdUTQX+bIxNRjgV8SoUKtRz84ax5RuEaOnHVDJgmp5DWXXbLDrydqrWbc9MxznfVL1LgQMS+AxwX94r3ZB1pTAiXjzrKKdi0WPuOjjSQ== 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:(13230028)(4636009)(396003)(346002)(39850400004)(376002)(366004)(136003)(451199021)(1076003)(6506007)(7416002)(5660300002)(66556008)(316002)(66946007)(36756003)(478600001)(4326008)(66476007)(8676002)(8936002)(86362001)(4744005)(2906002)(6512007)(26005)(41300700001)(6666004)(6486002)(52116002)(186003)(107886003)(38350700002)(38100700002)(921005)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 67LmwitXJys7m24x6TBfrG/aTRgyrxIzKU32K1YwacYxLn7efBBdkqlrmPvxzeAMvgn2WMZ4cYe8kNEQhe7UzTD1Z+BrCqRJyLqGg22+5oN0RwvNHpidOfAq5RE0yzsRCOjtBz+cKi09F0hrz1bMvwRYVACfRQZ6xVoh2NcV+stBuOjuVj0cSXPJZzz5Kwv/xTUtcl3LcoZEHLG7WoBdAJ1uVHaLfy7ICOPe8v8six7WZmF+4RvRJj42zotlGh8zWA4aJpfAXrtLgmoKNdE/IeEsQzvBmcMN83SL1t9Xd9AKUcHUg/elPDtiqupRJVGxytMQfbIcTHNvgLR+3QZ94+T0mMgJBJI5OpKBJwxEp6thAu2qLymDcvfWBwEywVTiKGD4hMQAW8ze7Upf7i/5AH/qGHRQIsF6K8iKJEHFNoqIaDBBSWl0WKjPwdv//eV4s9m3yUr6ieNr8n8h9plbZ5eMGj3/wT5zi8V/InYQ29Cl6P8USQS4WIuNXtS5uidA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5lFWY4/Hq X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad21436a-a05b-48f0-39a2-08db77bb0152 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 09:35:26.9921 (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: 7q2dALsHz4D/2FCng2DqCwpWJtTNbDjKL8KP1Ml83WvhperSYxRjV0FVDcZmn8aNvltGlzMwH+zV2VWUqY2asA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6144 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use bdev_logical_block_mask() to simplify code. Signed-off-by: Yangtao Li --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index bd091329026c..fd2705465a5e 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1128,7 +1128,7 @@ __getblk_slow(struct block_device *bdev, sector_t block, unsigned size, gfp_t gfp) { /* Size must be multiple of hard sectorsize */ - if (unlikely(size & (bdev_logical_block_size(bdev)-1) || + if (unlikely(size & bdev_logical_block_mask(bdev) || (size < 512 || size > PAGE_SIZE))) { printk(KERN_ERR "getblk(): invalid block size %d requested\n", size); From patchwork Wed Jun 28 09:34:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13295455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D5C7C04A6A for ; Wed, 28 Jun 2023 09:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231919AbjF1Jsb (ORCPT ); Wed, 28 Jun 2023 05:48:31 -0400 Received: from mail-sgaapc01on2101.outbound.protection.outlook.com ([40.107.215.101]:60052 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236017AbjF1JhL (ORCPT ); Wed, 28 Jun 2023 05:37:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MdDfkqR+/PF+cwiAUM/5BUMutgNMslzfb0oovB6FRwDMx9JwauVDhTdbkN93M2Rp3D3m1Na7IcW1dG1KsrfDt3nOBu2Ay351l0KktLnEWyz+c7BD8zT1swCcAaSZKyZ+zuBUsT1WfjbqzLHwmHaZlssD6BgtBOhbC5VEXQNuvcomseP6GtMTXOlU9xo24E7UroiwKWD8H5nYH2FuiaeEFXt1r2o7qlkmJc23X6nsSepXoM2Lo6azyu514YWcNXM6YxVwSPO/nVq6bWcXunZI2oIirVl+t/Gjrc5vt1c7RPxFYz+UH/Lwsqqd5/vqqySKe1C3ZoRWXy0tk2V2uohgWQ== 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=kzEDgAEQVi5wCWL3HPqAmdNfo2Ud7DOfhWpTaRZRXCE=; b=M0J1iDfdFVjxFlwUOasiRY3uwwNUiq+MaB9pvNurN9GiMNSrQnPnqFr5e/ItbBadHAz3RSzkjw/btn0tYeSqMbNobI8beC75lJ0DNN2u+0O12fM+0omCQtEcg+ayRcE+4Ct4iR30s6TuhjlDW2aaS078yzg8AoV7wdy1Wb4N85VaN1jUYFSnHt5Ng3eEILAk3fBj5U3JuQu5qZxl+LgK8ii8pK1NFi6cw8PDx7aOqfsa3dgbE2UhyShAVmE1OST0t07gDuOAr46bojkz31RWHab803Lfy+wnbNL7/Hi0mPr55yOYLUaF/28Pr45XmvmDEBGk0VZJ0EAGnrNkvUtubA== 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=kzEDgAEQVi5wCWL3HPqAmdNfo2Ud7DOfhWpTaRZRXCE=; b=PQaKbU9ggfeZOuu/ajFDfGC0xZTVyELlwf8KdR61iEbRPgzDfy/y+C78MtlTX108H47M4JB6TTLGRWsIc75BXJJyeBuEHHcrEfM2vElQhgJDw0Y2EbxvUAzNGNuOjCsZDiGyDSq7MlQELF7TaEaYGQ4mFgGEN2rnLB7AK+sxIdEKdhx8iDGikXpKyLqSuHn75d6S4pONpqojksLPpZE2q/q4gvuYMwSQhC8PbgE5Cl4Qt8GjSo1/lh2JHDbSvjqpDz1cVUHkaglEILE/bKD2hnWcRQwrHQjzGuoOZZXvIP6FCFpZbcR6/zWZU2Bwn/KcOd/pN018fAcvTC/9qkrG6w== 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 TYZPR06MB6144.apcprd06.prod.outlook.com (2603:1096:400:341::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 09:35:30 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 09:35:30 +0000 From: Yangtao Li To: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org, Yangtao Li Subject: [PATCH 5/7] iomap: Convert to bdev_logical_block_mask() Date: Wed, 28 Jun 2023 17:34:58 +0800 Message-Id: <20230628093500.68779-5-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230628093500.68779-1-frank.li@vivo.com> References: <20230628093500.68779-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6144:EE_ X-MS-Office365-Filtering-Correlation-Id: 72552399-3a38-49c0-4063-08db77bb037b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x4mB9eMHQh1osKUvbomwi/OQODyyX/HTXoSlBrVToMj8uK9zfYxmZs2JYG6RUVZccXspJpm9GkYnlM+AYVOj+lGl6zumow4ucC50t60QiQmJ2p2NigNYB4cG/eRTHINKRtzMfCKIdRnLxlyxDZR0OC5ulmw5vOiFz+lDr3r52zndpBWybYMCDud4SGv496ZbRTsTDgseVq2iMHLOc5kjMxRGPdub0lvCioTMlow1a3IEWKy6cK293XyfkiB3/U2ieEyVsmfUrLUkkGPlhm8n7akiBwQo/lyR+ZehUGH2PnnruXMkzqWDFvdnh9CjQkERGXy2OKBw82gVxqeu8hS27uHSYUFO0nupXjgGd8Kqg9bz++tn4le97uVe/23XsNiOMJ2K+v5Q5sIU8jDlAQRst1emaAmA9AQdOt0IuOKf1HWu0EBZ74YSCV8B/tm/yslMuo2U5cW9FBqO/Sb1KCLih8WtQ/vS+FCV96FKtEK1aiF28sixrjFYotuHL/qCuCEsf+Jzhm0ztorX/t7aZT9E0M2CV2P4JryGBW6HREuvtpaQAbO9wuiSDTKqf0R4TpY6puTJ9O7WjouupEwvgT2MCWVuGqT2EUYzOoG2LSmd1SIRO+3hIswrwXNk2rJyEyDdZ5I2kNLKUViW8v3wbtVtag== 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:(13230028)(4636009)(396003)(346002)(39850400004)(376002)(366004)(136003)(451199021)(1076003)(6506007)(7416002)(5660300002)(66556008)(316002)(66946007)(36756003)(478600001)(4326008)(66476007)(8676002)(8936002)(86362001)(4744005)(2906002)(6512007)(26005)(41300700001)(6666004)(6486002)(52116002)(186003)(107886003)(38350700002)(38100700002)(921005)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cak2CMvly5wIUHeSoMUiuA03PAjSv/FsSOsWwYE1RvBwPecqtRphG3mPXUxf/niRpghuoxuSFPJGvzp81A+WEiQ5ru4/2s929KeEhc7E+qpMuvZT9o+XTsF80HquA3V5WgTcbb8ZsxVrbo4LhOT1FqjWhgczrWR4SG1S4ev1mvDT9hkR3id+v+/HZYoRTS9Sv/jt2UVme0Ag9yhU04bHmAffc0z64ZVkvLuUtvCRjZp2QyJPikpLXh99NBhug1x4kuU3Xg6Qko58no7hBcwdbJzl/SCp3l2nAjLU/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VbmgqwCOBv1WgOTm4K3lId3QRrOuR+VnPk7XNFnaiKfDrepQuw5yybnxxsbrDtwuOtVmxw1exgD3MxkI3X5+4lIJjb78iUmBYvBTGX29bT7bJMuBkv7oCiuEJdNHlBr/Ujq9pExO6rAHb7KZ6RhokqBFevYFNcHyv6g6ZCLw4gK4fgEZauG86mtXHxwRLpFk2xPdRWs9q7P+AsxXYgZmh5k84hA0j0rzFgoKXzj7 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72552399-3a38-49c0-4063-08db77bb037b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 09:35:30.6164 (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: u9DFoRu9kk9yAVbGXZLkcZ1NwU/3GOdxkJlPf6DKckHcu6m7zFenNVGP3TnK9oIfAqyEjbq77dP5vA3O3wH1PQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6144 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use bdev_logical_block_mask() to simplify code. Signed-off-by: Yangtao Li --- fs/iomap/direct-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index ea3b868c8355..8d4a06bc14b3 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -238,7 +238,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter, size_t copied = 0; size_t orig_count; - if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) || + if ((pos | length) & bdev_logical_block_mask(iomap->bdev) || !bdev_iter_is_aligned(iomap->bdev, dio->submit.iter)) return -EINVAL; From patchwork Wed Jun 28 09:34:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13295451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C54DAEB64DC for ; Wed, 28 Jun 2023 09:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231410AbjF1JsS (ORCPT ); Wed, 28 Jun 2023 05:48:18 -0400 Received: from mail-sgaapc01on2132.outbound.protection.outlook.com ([40.107.215.132]:35171 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236050AbjF1Jh0 (ORCPT ); Wed, 28 Jun 2023 05:37:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aFY/DyUWFKoPNvuGVqPRx3QhH8TyAGEPU+TtbLQApOciLQNUYyf5TPVgWgAqtFL+oR05qn4yb+zsI70e5fTqjUc7CFdj4RuJ+areH98jxMZpINZ7KLISt6iEopTfxsDUOcj96vbFjISKhoGt0MeAVAdUMUeSnKymhkfwboCOqUcYlbFdJLMueZBM4vgqRCl9q19geYzBQ3vUYRs/Rcn6E5Fn3b1zTWRdmeqFyPFHEzrcWfzXmqjggpCZOfEg1M+oarlf5t7MqHRocA7tpK5/zBI4uSXfVILXSqRN2/IL08Lny8diKq4oXdtF/WcDFaYXz+O8JXAVdvxbDMBWEvlfQg== 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=GCINtTSOVFpd1YHsCw6PHLJKl9u3lVOMvIkmIKd3mSU=; b=jAkeBezINo3gkWi1Tl2F4nCbu7e+RGz7xJNdW4YfHrWWP0+g0ZzcNO6nkk+5U0PUWfIbha+riDlMXtCfR8qOYJ6AXUU08r4SXCxmCTpQQ5h/eGSLZblKq8rDjoLZAphl4vrwLYjwreWIL/bq18/bbTUpL2knxxfJThIFeyZEfa7vFqXlakYlCEPi2KoCt6/XqskdfQtWH7S+OMa7oE8Ul3TPdUkqAd7y2eMBg2ZAgoVZ9kMrYJXdsKl5o4WZG1ggZcJG2z3ZSmYZKzTeDCjt6BsL1+3naV+3lNCyvi+TzQ95lR4OddFLip6n/voa024CENsUYDAO6aUZibAErU+1KQ== 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=GCINtTSOVFpd1YHsCw6PHLJKl9u3lVOMvIkmIKd3mSU=; b=YurJfh9Bc6OkHDngK88Kbn2HDzjodNcUVEYuBioTudzj1P4VY5jK3Qa7GWxOASIZcPNQaq7+BinuTyLcp8HeKZmBLHgBnTlL6Nvo0mg2BrIjasCUPGV6l3cUlebXzOhOndH9sQwNXDCQDNRl+tn7HWT+exc9iy2g7VEIfjSPYpRm5mQVt2wYaMeKdAvcTJFqeclqUFm4OW89vqTEeO9YriSuFrZyjhHhca5eKzGQEFo7mzjGBv17VJxluSy6Cq1fj+PRhVwtFryGZzQhO5ONZTnd2V2mj34CalrMOr1u81oEZvDWgP7lcSyVCyWTEs29BwBvctiHfFdQLnwnnDajVA== 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 TYZPR06MB6144.apcprd06.prod.outlook.com (2603:1096:400:341::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 09:35:33 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 09:35:33 +0000 From: Yangtao Li To: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org, Yangtao Li Subject: [PATCH 6/7] xfs: Convert to bdev_logical_block_mask() Date: Wed, 28 Jun 2023 17:34:59 +0800 Message-Id: <20230628093500.68779-6-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230628093500.68779-1-frank.li@vivo.com> References: <20230628093500.68779-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6144:EE_ X-MS-Office365-Filtering-Correlation-Id: a2bfde6c-dd0f-4e8c-2665-08db77bb055f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lC+Ao4K7+hWytrCM7wxdVIbp2/xTWBRmZeVQ9ayCQCZbgs6YthtUKsK0AMbDwcNIsCa2qWMw1heNYVmN15t0+JgYQyPJ1szPCHqYl8jUVM0Fwj5j2YWhjvYqwlBm55zNOVzbu+d8m/TIWNLSKXy1XWRjscg0hpkigtbwcF5gPq8txl9niNRSu9hxAPThwFpz70mGT2tES6259xkVCOQtR/uBKBf0gu2Tka8O6+LNLWnmea9F3nH9ygR8pewXsHgEBxZNRQKN+U5eisOfnnMOUF0lLdxNXY+9mGSMJ4X0HczBd9e/mhmIsau3vO3KO8QEUU257LCU9j7oyLzSuMSM6sHf/WAva6dk5aoIp4wnk+Nudv+MUdRoaiHm/QbKlTTp901pdY+zLerradyTzQx0w+gibq+EL3qlgCp3p9K18qUqXhskLGmBGWkmxYiOJQ32UVSUmy/bXdtncf54Aw2Bn4GzDKeXaIKJUmls+fqU0xnN7W0AvDUTSnK5V0WTkKRA/q8B2z9Dy4HyeTzfGYGdGBO44dqg9WestRISNapYyBhSkpbhDNzZd5zvE0wz2TEivxBKScvzGPpl1d7D6yD9y4p7M5il5B7axuwia6WZVIGPtks6M6t5aLqIO8a02RKq7XP69eLGHy7rNHLlLHQaZw== 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:(13230028)(4636009)(396003)(346002)(39850400004)(376002)(366004)(136003)(451199021)(1076003)(6506007)(7416002)(5660300002)(66556008)(316002)(66946007)(36756003)(478600001)(4326008)(66476007)(8676002)(8936002)(86362001)(4744005)(2906002)(6512007)(26005)(41300700001)(6666004)(6486002)(52116002)(186003)(107886003)(38350700002)(38100700002)(921005)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LW5bfHbnbo2XHJhvAxypkYSYiYGxEQg5zp8R6Uexm0pO41cjsZ31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4gjS8Q7lXiXi4VHBP0FIKJeKd0+FnaHD2rSSDN/qRTXwQY7SDKdGK7YjkffXMdTAOwrySL1dmapW5AeIL41amymxrZ3SAk8a05G32SdB0oBVQq6nLk9qDlcfB9x+nrkJepH4gF03TT1tnLspJe+qH9MzBz0KUhAXbpdFkJl3lnoEwKXQU6uXS7cVFBmZyPrEym3ud+DZMnnj2Cm4xCgkQYD9dhpdr8K4eRx+dMJ9YwBhKEKrzBPo+t7XLokooe3nGQFPmAuX4Puscj3loPj7zPqccdo0uA8ZgYLahcq3mlY7V/2Yxs1PLXK8zX9ck3c5e3B45npRjSQXVlwCLP/pm7DQdP8MtZH3plPrQ7XrWfrICDpvhe2/25gRFMZC7KjXjm1WTujLjQnAulsBHBrSSlDAPADbt/NuiLdDHPny9zjhtinZMIa2iLyYyMd19Km35vuZVWMYuimu/WfcdsYhxCGy X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2bfde6c-dd0f-4e8c-2665-08db77bb055f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 09:35:33.7988 (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: cPoWNxqHnJ7o4VCUKKHunYZzTs38GOzkpx9uGcKKHgiLw6LrzxaiUB0zo19wUPgadQ+z95mrAwCPo+Hmcz44hA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6144 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use bdev_logical_block_mask() to simplify code. Signed-off-by: Yangtao Li Reviewed-by: Bill O'Donnell --- fs/xfs/xfs_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 15d1e5a7c2d3..f784daa21219 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1968,7 +1968,7 @@ xfs_setsize_buftarg( /* Set up device logical sector size mask */ btp->bt_logical_sectorsize = bdev_logical_block_size(btp->bt_bdev); - btp->bt_logical_sectormask = bdev_logical_block_size(btp->bt_bdev) - 1; + btp->bt_logical_sectormask = bdev_logical_block_mask(btp->bt_bdev); return 0; } From patchwork Wed Jun 28 09:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13295456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C27EFC04E69 for ; Wed, 28 Jun 2023 09:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231954AbjF1Jsc (ORCPT ); Wed, 28 Jun 2023 05:48:32 -0400 Received: from mail-sgaapc01on2097.outbound.protection.outlook.com ([40.107.215.97]:47553 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236097AbjF1Jhn (ORCPT ); Wed, 28 Jun 2023 05:37:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/r8+7mhTV0OQWmUToeNm5cHfYcLw2p5eNZepkxYALGGiarce9eV5AQNjIzWkFpl2tLWKCoq7XwMy7twyAgfp4oN979AA5wVFx+OARvSdoc5eC7/IOC2azFVSWhWtWAM75g6mXPAv80C//J26D1DgAa1NMRe6szIFqCmQ0eBpZCrsHQvdnDwTXWXP+KCswOpu62mf9LihN3f/m29kpYdSkpt4KtXzscaNDT9zdivNXhVlMnT1m+48k2DKUWCl3aiPfdGOI6+4bR50WacBq7EgXmCNv7fci2d3qACjwTgjCHVdfOhUve8iNZFuw/gqo10iCOVTMh7Kz9L6Rauobd5vQ== 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=IsL2UGvM+v2DmEyeq03rERsDBc1tSyqKLDxIerRuBTI=; b=T01/eCWiRYaJIYiXHPXAMm5DGfuD6uT02KJ2arCuiA9EX9u/88TAh0g33vZDG2/6lh/3kP52FlEI72wqmg8QvTBXN7kTe/Z+jv7A5b6+aNNGsVY0s1i8RGTYXznmh2vHk6153wgIenxwoc2n/Ql+D65Aam0eQ4mk/hTgqTbRmA9btunWACZKeuJyrQLXUIWabAZ0/vzLKNN/SO/21DHPZ2NS4dIbVqpNazySbFBUFvN7oCOMte8xQTZVQ5NFePLUWdRCpDf/Ljq+nPjGEqk8HzpslO/iMwyAfQ5oH18ToLDqCAAdJV9RVtrQLbeDeNW18x8+csZcJcvspNFArRxYWA== 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=IsL2UGvM+v2DmEyeq03rERsDBc1tSyqKLDxIerRuBTI=; b=WfnlZPWs2DpE/88ZHduXwmEwngqB9t+5mX6gJP1tzKB2d3auxB83lkoRKclfY5MO78bF+GhfdCQ1V1v/ug7tlovv4XEoGmP6RLEonJE3RSYh+Fr2gbFM7mmCPWj4Gd69oRgNiF9QIT4UULx+YCwZv5cBHebq37aEtDmEg5uKWn2M7XcHuvBQfO9PZN3c3Pivtmy48zcjgUU+rYXkjToHP0Ex1ZJqK0BG12BzEDtHVBA0lA9isNrge7PIwbvNZF741SIUdAS6himb4g/eI32Lg1ba2j7yTsilnflgVh+Ak3Zqgx7SVnC6vQX0ryvhK5hlGmyqAL7k5DtjKVZgt92SYQ== 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 TYZPR06MB6144.apcprd06.prod.outlook.com (2603:1096:400:341::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 09:35:37 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 09:35:37 +0000 From: Yangtao Li To: axboe@kernel.dk, song@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, hch@infradead.org, djwong@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-xfs@vger.kernel.org, Yangtao Li Subject: [PATCH 7/7] erofs: Convert to bdev_logical_block_mask() Date: Wed, 28 Jun 2023 17:35:00 +0800 Message-Id: <20230628093500.68779-7-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230628093500.68779-1-frank.li@vivo.com> References: <20230628093500.68779-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6144:EE_ X-MS-Office365-Filtering-Correlation-Id: ad1bafaf-53e0-431b-6bbf-08db77bb0764 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GUrSj9uGwKNuLk+cDNMGOs6EcgJe+4LGGZeuvPeJtu1fBHeGPfsLCCSCP+unFNSI9jfFMpGiNG7Vo0nOaxaCRNiSGfVLdC88EnMmxmWDOKQhKAs3feLhzDxIqxLye+U2KVQ6xH/KL7rzQt7TmVtXcvq5l0SKdvyrayqjLs5XkjrNKpL72a++JniCLHqSkYbWKcknFX8foL8NAWDAHWH6lYvWlCC06JXwlpD9T213Wh+50G1U79AaFtnnZOsE8Xm6hN1kiXiWRvuKr6ruLh7+KMVVy0rTf7W3fo4nT1BTQNZhjL27sAkV2bbQRjrJ7nqm38jnzL5r68n4LgGl779oeUfPUCKUQSe9qOtfEyf/lHkIvNZHs8uClkgFIMfMuIL4qQFQ05XGt/5hXuc7cLJovUnirryqWrxAvzrJ1JKzYrR59cTWCP4fl7iJVmJwyD73iBAdP49izWROPEEi8c0RDh0WioagUZbzYRbFBMK2oPKp/SBdjRVfvzr2BKMGFVuoNANgA8Dr4H53+532VlYnBv4xCa3XWIwQp5bAbn2w6u+VDfWn0qVE11AoGqOu62ZRmwFyhT6Jr56s3eQ0Fm3Mt+3T5jeOKRrPY3mg6UzyZg5CW5mtJXXkIUYHn9OoZ8Gx30i+9G51lE86cQ1BuVspxA== 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:(13230028)(4636009)(396003)(346002)(39850400004)(376002)(366004)(136003)(451199021)(1076003)(6506007)(7416002)(5660300002)(66556008)(316002)(66946007)(36756003)(478600001)(4326008)(66476007)(8676002)(8936002)(86362001)(4744005)(2906002)(6512007)(26005)(41300700001)(6666004)(6486002)(52116002)(186003)(107886003)(38350700002)(38100700002)(921005)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cptW0/GIcoLqv+v1laDFgdSiMcYeUi82qxSJ42wyjYT4Fp0WAaaMTfBAjsBVt94tSshPsoAR8Z8HiF+F2qefUCbualAs7u2YdFVgSyGELYc+6XjZl0St2hGshXNOQf1ndZ5bkmEYL6OjwtL394bKbaPibfyQnYpXLzpusN0kW6t1rZ1DLlznLxlBo4RTUMf176c66gBG4u4bNuP66ZL9LQeaSLyxRPUNF/imK1rQgw9vEQ5wYA3uAT1uz78xfHLzx+XMcj2aSYhXjV1KYBVbD6FeArkyjCwYWbW+d1/aFV31AymHLn6I8rJvHxkn1G/yMAM3QZAdoFwzDuaUx51smVL9f/0lpC7G8TSpjIXRAOFPFg+MxDqiDQB+Umt7kdwoZUiN+1lc2SKS+quNaxb0RV4M7x5HdRkELAcsHYab+nF5HpaHX2k8lobufdxFTyZx92zMlj7V0QxjrbrZDEBZkHmUA/iYh/W19gsB7RHkc8MN+q4cDFQhyQCdtcPR3pjjFsowEB1if/is3Jxk435npy8jEN3awxyCefYW6//OEJpufx7IK0Fu4VyLWcY7s+5MKlfpC6LJCNslkgmkGQQFHMI+5iE/H1AoaMoQWdRNkHN5Jp0uINX8HdHm665JC1NeIXayXChWlQik1M7Posi13uN6PjUZutfiZHpqBrzokaeG0+HP0ZhUjNVIt6zW0lfBhnCBaS36YWawH+rVPy6uw0IQc0Xr6ZdfAr2KuSMenoMaadAMOJyVM9O0RvpSEQLPpzHvraSO2MKx0TG627ziaLnBIECw5HLSp2B2EErcg32beHJirysLbJ4I+W19IdioJciUPvCAn/Otp3pnpbq5JycsgSRvt/VhK3lgCnhfLJHiLDqtWRTns6n9cj+VOt++cHnFvlqan0OQmlFa4YwIj5yc+i6WahYkO3wSEqVBzOgLS1a7V6dv5DWaeMjdEGBKUBtv5trrflHnDD3htHQYMu+SVfd/MjFtSObEu5rfVI1j2qn41+Lc6AmkpdLRxokd7D23FMaGo5NvdfjsNRyPYKzOJ++DELaO0/C2zo8vRWmFB1FiKBXnpErBD7gsirPkugK8NEimNHlbX4oV2ZJN0aUACR0XbCagShrr86DQpfHQtHtnkCIJNR+fSWmzYX+rksISfZSnGNoN3is71OoSQLXYPR36XBgYP8q833M7fMkfJuyG1b240h+aQXK/eVUd1/4BD3XIk/t/gh0S0bXAucWdNTGJGlnFEGmAkVBBS4IaiUb91rCM8G8IkkxAErPByOc0PCIsuoR/u0OU/FZwmyiDZiXa+vPieetNIYGGnUBJxfa+CWm/o915sT3Ghj9NCZQRRZQitPGm8/DGK6BKdZrMNzgLd1C/DDcfbt4sKO4sTYYjucXHx0xSnKXXWZhwnr2c5xRj0Gv7ph/GZynpXWx9mdPh3k9z7gC/O2Bs/IoTgrToUWzNA2vWJVGIaphipx3eP4v2e/VAQR3+ArtzK0B9gy+izs0OJ3DfJW84zJLvRlOlX+/CC3nvnjpQv4dxQBF0pNL1xIV4+eo4WzjdvRnTjPe/qHSlJSL6cumuYIFFUYKb00bD21s5+RmxyU8J X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad1bafaf-53e0-431b-6bbf-08db77bb0764 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 09:35:37.1790 (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: qudxGvZDH1ZyDnTgVpJyEz4zF1KulO5WnE6Xk4ZXaFQ7UdxT28sOaq4WHgC1MkwO859g6LxJH37C3Epu70LKHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6144 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use bdev_logical_block_mask() to simplify code. Signed-off-by: Yangtao Li --- 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 db5e4b7636ec..13bd185ef3b3 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -387,7 +387,7 @@ static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) unsigned int blksize_mask; if (bdev) - blksize_mask = bdev_logical_block_size(bdev) - 1; + blksize_mask = bdev_logical_block_mask(bdev); else blksize_mask = i_blocksize(inode) - 1;