block: Rename blk_queue_zone_size and bdev_zone_size
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 <damien.lemoal@wdc.com> Collapsed the two patches, they were nonsensically split and broke bisection. Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:

committed by
Jens Axboe

parent
b5a10c5f75
commit
f99e86485c
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user