Skip to content

Commit 2f20872

Browse files
damien-lemoalaxboe
authored andcommitted
block: Remove blk_alloc_zone_bitmap()
Remove the helper function blk_alloc_zone_bitmap() and replace its single call site with a call to bitmap_alloc(). To be consistent with this change, use bitmap_free() to free a disk convnetional zone bitmap. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent f2a7bea commit 2f20872

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

block/blk-zoned.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,6 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector,
150150
}
151151
EXPORT_SYMBOL_GPL(blkdev_report_zones);
152152

153-
static inline unsigned long *blk_alloc_zone_bitmap(int node,
154-
unsigned int nr_zones)
155-
{
156-
return kcalloc_node(BITS_TO_LONGS(nr_zones), sizeof(unsigned long),
157-
GFP_NOIO, node);
158-
}
159-
160153
static int blkdev_zone_reset_all(struct block_device *bdev)
161154
{
162155
struct bio bio;
@@ -1482,7 +1475,7 @@ void disk_free_zone_resources(struct gendisk *disk)
14821475
mempool_destroy(disk->zone_wplugs_pool);
14831476
disk->zone_wplugs_pool = NULL;
14841477

1485-
kfree(disk->conv_zones_bitmap);
1478+
bitmap_free(disk->conv_zones_bitmap);
14861479
disk->conv_zones_bitmap = NULL;
14871480
disk->zone_capacity = 0;
14881481
disk->last_zone_capacity = 0;
@@ -1604,7 +1597,6 @@ static int blk_revalidate_conv_zone(struct blk_zone *zone, unsigned int idx,
16041597
struct blk_revalidate_zone_args *args)
16051598
{
16061599
struct gendisk *disk = args->disk;
1607-
struct request_queue *q = disk->queue;
16081600

16091601
if (zone->capacity != zone->len) {
16101602
pr_warn("%s: Invalid conventional zone capacity\n",
@@ -1620,7 +1612,7 @@ static int blk_revalidate_conv_zone(struct blk_zone *zone, unsigned int idx,
16201612

16211613
if (!args->conv_zones_bitmap) {
16221614
args->conv_zones_bitmap =
1623-
blk_alloc_zone_bitmap(q->node, args->nr_zones);
1615+
bitmap_zalloc(args->nr_zones, GFP_NOIO);
16241616
if (!args->conv_zones_bitmap)
16251617
return -ENOMEM;
16261618
}

0 commit comments

Comments
 (0)