[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH V4 4/9] blk-zoned: update blkdev_reset_zones() with helper
- To: linux-block@xxxxxxxxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Mon, 8 Jul 2019 11:47:06 -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: Mon, 08 Jul 2019 18:47:43 +0000
- Ironport-sdr: CbdudkSwxJA8k/ST1T/kuCKTasUlMSaZ0W74scRtFUjAIjT6mFX6jJX02IGEOEHWkoK6jraOke coZxJKxpJs5222ImR5/ihhroR/uTPRCx1L5ltgx1iobIpocwWr2XGRsCcBGOJVoLblwhGovhwq rVvEusmKmLAjw6+64573aY1PFZb3YwHJxCXiDOUPG1XWfpjqJTiUo+/LlpXWQ1N7bGkJZdMLDg Z0nfJLvQvcMtzGbDtaQDTUsM17d+QWaHO0ub4F9zhh3oKN3VqXJpcWxqwT27HdXtuLH87PsfIc Gng=
- Ironport-sdr: XY0WglFWpV3/4cUYIQPdy3gAEJ1U7hNu/ZTMEPFc5d/tspiKCmICqDtJl6woC8v1V4ESqRz9ea fObvbAADRwUIsRZZHTZY3FIedLrwK+tQVvjf4XsaKFVZRnK+DVx9VyO5sUkfRVkoA8kRnmsMRo 867YXe48p8YCoQJZcEZABolp07mxoMyqXf0yoIdrWHlO6Z1f1XxrI/n9OjDGimCiYTK87cS9DP i+819Bp48BCkWsjAM3JeqPXuXzTZkWhWSmQA1MhEl3d2xtgsZ0TVbACOUQXdkbtWrEYVEhwq88 EHQCMzYgcY4J3NDWEvCMxtsZ
- Ironport-sdr: e+wnXG2Mz3gtPkzW6JVqDomjkR+WsCClgTYVA68ZPRVD1/JbzvZKAnfiawuajy721alH/4cYAz 83R6mt/izAcA3wYqxabLbqAjyVd0jNtKCxpgAgTCPzpasYEs7lbnvuC3N4aFMecDj6sBrnSifF 82Ij40bI/YXlgLYOhl/4Oh93z3ngwfXd/OnW7O5HcGk/NS0jd+rAtkLqTzWO6jaL9i1E18+AqJ 7S99xr7IczGeGB6g7ryoF5o2/SFFru90R9W1IEnAhWc+kyfKs7iZ6KzcqN/cZ5rpgMFzYrCS1q EiI=
- 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.17.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|