Commit c1e7b244 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

btrfs: use bdev_max_active_zones instead of open coding it

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Acked-by: default avatarDavid Sterba <dsterba@suse.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220415045258.199825-9-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 998e9cbc
...@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache) ...@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info; struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL; struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev; struct block_device *bdev = device->bdev;
struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones; unsigned int max_active_zones;
unsigned int nactive; unsigned int nactive;
sector_t nr_sectors; sector_t nr_sectors;
...@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache) ...@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors)) if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++; zone_info->nr_zones++;
max_active_zones = queue_max_active_zones(queue); max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) { if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info, btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones", "zoned: %s: max active zones %u is too small, need at least %u active zones",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment