From patchwork Thu Jan 12 02:42:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9511869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC2E1601E7 for ; Thu, 12 Jan 2017 02:47:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C02C22863F for ; Thu, 12 Jan 2017 02:47:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B49FB28679; Thu, 12 Jan 2017 02:47:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5E362863F for ; Thu, 12 Jan 2017 02:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751122AbdALCrQ (ORCPT ); Wed, 11 Jan 2017 21:47:16 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:30183 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbdALCrO (ORCPT ); Wed, 11 Jan 2017 21:47:14 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="59592480" Received: from mail-co1nam03lp0022.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.22]) by ob1.hgst.iphmx.com with ESMTP; 12 Jan 2017 10:43:16 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HT7Pl9zj1ukyogOVhHI6JKH+F3w8ja+mBLcVBh6zayI=; b=CQH6M47NNMhvlCsDtpyTxQ/IOFu3mIHRT4AQN89ESZEfJWPEvks9ktOmWbq4BgmBH1oZfdTJoSWwhRYGEvWsxnYxx54fxiPflW1h3XNZP4fiVHIS8GoJWqBo2LxBq7UgMT5gv1jInJR9L+/WtVC+q9XRAXMoqU7tQ65A3HQ6KmA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@wdc.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by BY2PR04MB1973.namprd04.prod.outlook.com (10.166.111.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Thu, 12 Jan 2017 02:43:12 +0000 From: Damien Le Moal To: Jens Axboe , Jaegeuk Kim Cc: linux-block@vger.kernel.org, Shaun Tancheff , Hannes Reinecke , Damien Le Moal Subject: [PATCH 1/2] block: Rename blk_queue_zone_size and bdev_zone_size Date: Thu, 12 Jan 2017 11:42:52 +0900 Message-Id: <20170112024253.5814-2-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170112024253.5814-1-damien.lemoal@wdc.com> References: <20170112024253.5814-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: CY1PR17CA0009.namprd17.prod.outlook.com (10.163.68.19) To BY2PR04MB1973.namprd04.prod.outlook.com (10.166.111.13) X-MS-Office365-Filtering-Correlation-Id: 1c2bbf2b-611d-4e9f-dbc6-08d43a94c146 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR04MB1973; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 3:Daj3L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rPgaICg1AdL/k5bXP2ni92DGS1A== X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 31:7DnZtSnXMQJxVsk8UVJZAJxhQr7IATI+WHMXSRYGZG6dqNd1ZOtIA/j7fm9+pQnAEKca4fRISZVbhjQlBxNlyrFIDv7UXx7nQ6XiDRVcCL5I8RjDnO07yoDQHCxFDPXMAFkKmWn8boF+IOZ+1lFNlU9KRWoO2rMT4J4QowINvufmVoEgYZsV1CW6dI98i8kFzn7wkKKGtSSoSWSkHk0wPCdoXMkyXqdBXTDxaT93dz7EsDKlekwLLdjE4L4eBxXl; 20:kIKi2WSDtwo4rvHLIMelceF5RpDL6cWEJYRkxjdiuL3E+W1QpMVoUUhachEeIsDaG/Vc5VVXpnsnjKPdDnstwzMfQ+Tq3cludsKpFhLXe7w2oh0kLC4Payco44OVmnRQXifdeZVcOMNnT2fcWaa2dWG6diKOChBPvPgUyCyxgniUbfsHDDgg0g0RC0F1HmI4N8paUYL60/gn1IYP/xid4KL3w4qW21iJeLSdzwpr+h200Af+GX3Pfj2uxtXyw/73V4SDRWSoMi00LFlnByqAHm+j24HoYuydlDa4KP50ZGL0H5J9raS+TNfh50LRypvu7xajoJnBdG2sCdE+KqxMBQlIFHrTscQEal1zTV4MT/uNghDRc3ltTAkVyfMl5cbV6X1clJQ05KneilV4LHXtrXn6P+sAAlG8nywxzoSHHFTS2aruWXAUBiA6/Xlu3vbagr+wjCxIRfVsWO4Ahj2H2ms/Pgemw9GcwqmscLgMbp8xapL/PcB8HI2TT1sTuUzJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:BY2PR04MB1973; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1973; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 4:59r8uq65Dng/pTgK3kvdoYfe7OtqxrUaePiDP5T2FnH635dbA7vu/MX0fy++ThUs8qjoq+d5koAZBcoHLQwQk6HtPxLjo9kXo3Bq/kGIjhtBQkufo6hHl+B0EMwFIuDvHwdZcemyJP+8kGbHpFxATI54jIT5vsmnr+Apxl67/kN9LNt3+s9b7qAZXhVOU/smWc+Y8ck2w1Kx9TeH6EOPmX7YIfXC08FhBqiyuhxsAKcd2SpivPylATfVjzclDaaRQiVHQI4C4jQcH9faPvONC/msaT7ZyHMTxZiEFnhK3JJty9fCZ2zKy+ArEsgoByxpYMF8WG9BXiGulkW9MHGvRhzHqgrz/55D931RvbWfEMyYALbOvb6OHd/Sj+D6qbr6tEbawfd7HatY68ExKtnA+Ref2dL2pH9JpqS62OIrksx78URAMn9XZq5owEFAE1/lcZDMEpagrLuQp1CrRVBEE9ba31dUJk8Zdek9XAtMih1Wi9Id/PBq0HMjV2LnpH7MgV8xSK0oivhasgLwE1P5PG0SLHBJGtl8VRuZ1tcaC1g3MDrz5HFNwxFYVjbK6mU9F4VO/fo72vdaV4j+gaZang== X-Forefront-PRVS: 018577E36E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(39850400002)(39410400002)(39860400002)(39840400002)(39450400003)(199003)(189002)(54906002)(81166006)(6512007)(48376002)(38730400001)(50466002)(33646002)(101416001)(25786008)(47776003)(81156014)(86362001)(305945005)(6486002)(92566002)(4326007)(7736002)(97736004)(5003940100001)(8676002)(6506006)(6116002)(106356001)(68736007)(105586002)(50226002)(42186005)(189998001)(36756003)(5001770100001)(5660300001)(76176999)(66066001)(50986999)(3846002)(6666003)(2950100002)(2906002)(1076002)(7099028)(21314002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1973; H:washi.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: wdc.com does not designate permitted sender hos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9Ozzsyt5PMCeFtyUqyPoS6qzcLMcHE6GdFgxPOP29IYVy9bmPOk1YvPxX0LWch0JCMn430FrIy8IDy1cjt/L3iD77sm1afD4GurTfhyVWCWH+DEL3ypaA3FVE7f1h9T4Qw==; 24:2BD4LZ5JXlHEittEFDpqwFIG05Us6J9eizJ6Vk71vwWLOOxwA7n5uktC1dhGE9ikfftKtU0inxghb6Q8rLk8mtB/qi1YWHj262aaJ/Gmf38= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 7:wKkNpFT55UBshaDHigiU8r5JobDLaJQZf0F6DKLD253oHf0gkxJirsv25amulFKZzaoiGrbOr4ssCpxKjo0/zOYMcf50bXo6cR8bmCpLIkaY18PF0WooSs54WtVMjMhqlZgyCLYBElo59gkqSnkZ3tbE3SN9E9YcnlRlHc/iIJJ1c5ociW50rNoubEriFwLoEUg6n+ri99I2/5iddk48NmjuLOuonOHchUqqcsrxDClHAt3YGXtlmQ7QVYRmC+Zjy5zjEkiGbxAWazKc/rqF26cp4EYi5LRcdDGeS312YK4EkYqNg/gKKzR60WRp9/zL0IP+UGeG8Sq2/9KLjAJlMwlaA/qDX5iMqm9hmQCH73ZOIfT5alJwWdHbriZv/jiHtTQz0Q7r22CKuoGW15Psxj74zsplR3fbkl00J4i8s3MawG4DjfVanUslJIOW9mM5oAGVvwnBn/83Nbvk0GHnHQ==; 20:IdNk1zvpT1tLzmEU/mCp8n8n8+bgyBPix+yoWMYOekPtoitKTmyUMX3XlIF6uEVZPb3o8Mou7ZxL8GFddCqsCQMimjJOsZMiIRuxAXHaOWc63nOmETFTIBsGevJ6qVwuwZoPfbBrXlvshiR+a4UvSv6H21x+7Xq7dhrVvbiU+01isKMpbvribacg6PCPXhauDbqhkiSlMXX+fVl0yliOmrRyirLdgiqEB8WWeK7XZKM6ppPbBAEhQiN/QIyc2vWH X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2017 02:43:12.5099 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1973 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All block device data fields and functions returning a number of 512B sectors are by convention named xxx_sectors while names in the form xxx_size are generally used for a number of bytes. The blk_queue_zone_size and bdev_zone_size functions were not following this convention so rename them. No functional change is introduced by this patch. Signed-off-by: Damien Le Moal --- block/blk-zoned.c | 4 ++-- block/partition-generic.c | 14 +++++++------- include/linux/blkdev.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 472211f..3bd15d8 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -16,7 +16,7 @@ static inline sector_t blk_zone_start(struct request_queue *q, sector_t sector) { - sector_t zone_mask = blk_queue_zone_size(q) - 1; + sector_t zone_mask = blk_queue_zone_sectors(q) - 1; return sector & ~zone_mask; } @@ -222,7 +222,7 @@ int blkdev_reset_zones(struct block_device *bdev, return -EINVAL; /* Check alignment (handle eventual smaller last zone) */ - zone_sectors = blk_queue_zone_size(q); + zone_sectors = blk_queue_zone_sectors(q); if (sector & (zone_sectors - 1)) return -EINVAL; diff --git a/block/partition-generic.c b/block/partition-generic.c index d7beb6b..7afb990 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -434,7 +434,7 @@ static bool part_zone_aligned(struct gendisk *disk, struct block_device *bdev, sector_t from, sector_t size) { - unsigned int zone_size = bdev_zone_size(bdev); + unsigned int zone_sectors = bdev_zone_sectors(bdev); /* * If this function is called, then the disk is a zoned block device @@ -446,7 +446,7 @@ static bool part_zone_aligned(struct gendisk *disk, * regular block devices (no zone operation) and their zone size will * be reported as 0. Allow this case. */ - if (!zone_size) + if (!zone_sectors) return true; /* @@ -455,24 +455,24 @@ static bool part_zone_aligned(struct gendisk *disk, * use it. Check the zone size too: it should be a power of 2 number * of sectors. */ - if (WARN_ON_ONCE(!is_power_of_2(zone_size))) { + if (WARN_ON_ONCE(!is_power_of_2(zone_sectors))) { u32 rem; - div_u64_rem(from, zone_size, &rem); + div_u64_rem(from, zone_sectors, &rem); if (rem) return false; if ((from + size) < get_capacity(disk)) { - div_u64_rem(size, zone_size, &rem); + div_u64_rem(size, zone_sectors, &rem); if (rem) return false; } } else { - if (from & (zone_size - 1)) + if (from & (zone_sectors - 1)) return false; if ((from + size) < get_capacity(disk) && - (size & (zone_size - 1))) + (size & (zone_sectors - 1))) return false; } diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8369564..ff3d774 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -739,7 +739,7 @@ static inline bool blk_queue_is_zoned(struct request_queue *q) } } -static inline unsigned int blk_queue_zone_size(struct request_queue *q) +static inline unsigned int blk_queue_zone_sectors(struct request_queue *q) { return blk_queue_is_zoned(q) ? q->limits.chunk_sectors : 0; } @@ -1536,12 +1536,12 @@ static inline bool bdev_is_zoned(struct block_device *bdev) return false; } -static inline unsigned int bdev_zone_size(struct block_device *bdev) +static inline unsigned int bdev_zone_sectors(struct block_device *bdev) { struct request_queue *q = bdev_get_queue(bdev); if (q) - return blk_queue_zone_size(q); + return blk_queue_zone_sectors(q); return 0; }