@@ -267,7 +267,7 @@ int blkdev_reset_zones(struct block_device *bdev,
if (bdev_read_only(bdev))
return -EPERM;
- if (!nr_sectors || end_sector > bdev->bd_part->nr_sects)
+ if (!nr_sectors || end_sector > bdev_nr_sects(bdev))
/* Out of range */
return -EINVAL;
@@ -280,7 +280,7 @@ int blkdev_reset_zones(struct block_device *bdev,
return -EINVAL;
if ((nr_sectors & (zone_sectors - 1)) &&
- end_sector != bdev->bd_part->nr_sects)
+ end_sector != bdev_nr_sects(bdev))
return -EINVAL;
blk_start_plug(&plug);