[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() with helper
- To: linux-block@xxxxxxxxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Tue, 2 Jul 2019 10:42:30 -0700
- Cc: damien.lemoal@xxxxxxx, linux-btrace@xxxxxxxxxxxxxxx, bvanassche@xxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx, Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>, yuchao0@xxxxxxxxxx, colyli@xxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, jaegeuk@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, kent.overstreet@xxxxxxxxx, roger.pau@xxxxxxxxxx
- Delivery-date: Tue, 02 Jul 2019 17:44:45 +0000
- Ironport-sdr: NSgnA9MynBeC/AGsBzj0EEKm9C403Y+ws+v21TRw9Xnh/LkZmDWn9yF++L1JxXNowhfvSBOLXh qRsYtomBs20/A4RbrBz7E9rm6HkSqvzbtLmrdd05jaq3MtPp8tbU0KQcnlJ+DmbFZrvks1hEXI z45meH2aO52uDyS/5QzgHUkx72wL2L2Yv9aM6BVtuLiQqRzEhC/Wu6DSycVMu8gaHZlLTpXl6q lGz59PtEHwrrgGE2/BLtJgEgk4xArOi61RjyLVvTFCEk6dnmx+6qdMHmg94yZpeuZe+cGkUuus V/I=
- Ironport-sdr: +35EbuUkpv7hCLKsNYyVixVCuVdtpQwQQ0DL2/wQcfpFf2mHtWsWCaN6tu3RGajTRb68GqgmSi 6VgTxNHBJmCyYhRTaMmDL/Y1sIrpbwhZfGrb1hHBUqWQAFho8LtFG29b/AWsHnmVmyhtKy6ucg zlYGy1bzAP8UWJyZIfpiTwkx177YXhQvrtGbZC3STe1NatBvQ1OJggZWdrmi1zm57XhdMZujZA CXffnE0iu6FBNvmWRRfXNQb7/j7P//tvqeS3wI1yvouP5wqMlT56MAL75DSrhxIvskD2dRSUvA EOVNZH3EAQi7KdMA1MsqUD/v
- Ironport-sdr: bTE73XoebtSY9BFEdgIbFq66JMRK553Gy4nlPM/489RzJLQKSuFC647ZNCgK6Pe5K2acESKa/v GSyMegt22LTGo7l8BRZPNNAHwyUWFfcwLZUe3SLCb0DC8tf1ksFmAOjIdeAxS0flNdl1Vpk0Gh lMrR6oroo8tPU1xiW0Zj+Yxt+Jry2cgDdCY4nPBcevgpALqZulp9n3CuGosdEVbiHNDUItK2WP v3BZh8J6bSN6Ou8vYXB9xka6wKDRw21EZx8JHyPMbb3NO9B1CD5BW+/c8McPByloJrrt7CVnbS N1c=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
This patch updates the blkdev_reset_zones() with newly introduced
helper function to read the nr_sects from block device's hd_parts with
the help of part_nr_sects_read().
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
block/blk-zoned.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 9faf4488339d..e7f2874b5d37 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -229,7 +229,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;
@@ -239,7 +239,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);
--
2.19.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|