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/aTRgyrxIzKU32K1YwacYxLn7efBBdkqlrmPvxzeAMvgn2WMZ4c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gregYzQi6tQg4ibrWMIZwrvNyFt/PVZq2og010EmuiAAq7rp9zXF1WKLgWm9oKZ7iAvz49Xj7/oXhjuQE58foVx8qTfz4KBln+YtSRY/7azmVMpA38AP/yZyc4uH6XjQm9nu0D3GfC20ttv66Ru9OgW9N2c8SJiBXvXEjXXVMhrGCc8uwZlRpX8KxMRvS4WfMikI4FQAxk6BA4NBia4zVFmSF7wfzglPXkQY9ofTSrKxMGe3XlLjiVycXuV8C46zHr2GXCJnB4VkeCncfH05dOUzDeTSwF8IMR2yMaSzNdEW8MOjO4F9gJtdTjojDkEzLoXx1wXcY5LstL0BxYiB1C+8/XX9yiu2xCtItggi3IIVoGbOI8SNjkuGOXHEiN4IjO+8xwOkQR2Tjmb91C3ThHYaW8wn+I5iZ1BTVe/6JsZ5ii5o6QQ+tVdV8DI5lFWY4/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);