@@ -109,7 +109,7 @@ static bool blkdev_report_zone(struct block_device *bdev, struct blk_zone *rep)
return false;
rep->start -= offset;
- if (rep->start + rep->len > bdev->bd_part->nr_sects)
+ if (rep->start + rep->len > bdev_nr_sects(bdev))
return false;
if (rep->type == BLK_ZONE_TYPE_CONVENTIONAL)
@@ -178,13 +178,13 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector,
if (WARN_ON_ONCE(!bdev->bd_disk->fops->report_zones))
return -EOPNOTSUPP;
- if (!*nr_zones || sector >= bdev->bd_part->nr_sects) {
+ if (!*nr_zones || sector >= bdev_nr_sects(bdev)) {
*nr_zones = 0;
return 0;
}
nrz = min(*nr_zones,
- __blkdev_nr_zones(q, bdev->bd_part->nr_sects - sector));
+ __blkdev_nr_zones(q, bdev_nr_sects(bdev) - sector));
ret = blk_report_zones(bdev->bd_disk, get_start_sect(bdev) + sector,
zones, &nrz);
if (ret)