[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH V5 4/9] blk-zoned: update blkdev_reset_zones() with helper
- To: linux-block@xxxxxxxxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Tue, 20 Aug 2019 23:14:18 -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: Wed, 21 Aug 2019 06:14:57 +0000
- Ironport-sdr: rfiKeW2PSYgY1/818PQmlT0ItGSPJZJNGJTe8z9Zk11wlKBKkDWqUeWUjaZyqkl1xH3iikMixj cpIWlCumZ+QwTYN6CH1/DrCrQZV6dgIyVXf4k7y6xJoU1ZxilHHxcc5jog7lybNGoLPpaSw0A1 UzW+g3XAhqzyLQH7jqdmhREErTpulFnfuKwxtvT7e3CnFYoYDGT6pt9ky0GfyFmCTgTanmuYEn 0ymn4QoOR1305DiFAZpsZNrTDqfwTmPQJhJlzH3V7+agtKhXz/dH5B8Xuu8dc1D/lqpaKDmD/d g+c=
- Ironport-sdr: xuF51Ei9CYb8jjqtod4lAhT87w4TmEBmkRgt0ChoLDr8emBvuOUaNtnQbkQlM6j7HS3WIFflem jnF+4oFYMkqGJwx7eUk+VgzAcI+4mzQDGqzRrPD9KESvTjg7dF76hsMQWbNeZZ2eDxrv8Bt51E obdoa7HCz5RqE3oq9szN3Qvb97s9PzOcxCY8XTQtik01weJ2xbitadoucyvK1Fz0YsuROBJBUc oDyANNgZ+e5oqev2oSIj2IjXJERBlz435/5LzbR8xaKArmnwrtXmgiyXEkTIOYG8Y4cIB0mwj4 mVPFucG6OfK4rhNopnkcDrs1
- Ironport-sdr: WGDSV7zozYwbRlbZcH9Vsh+dYPGAeQLVyYHbXF8UemtuqeBj1gbc3L2/qhUPOCHpvgps3+qYTw 6KCzf/ZLXk78xFV6cdmLogFtTGmboLlw3XK2ceoI6b2c+M7ALIPJEQThmicDSyitL7i3yOytT1 v+4Y82D+aKvlSZujII8U7Id+Kevc5LUiaZ6XBwmp2zgzzCpxiE2eRE2BNPGklnoPiudQmcQiOV UcqacoGyWtWWVgxu10FPvyFGi3BggvrpIAb2Pyel4K/An3TBhmBU9rAfhfEJ4/GlAyYSvjR3bp +mc=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Wdcironportexception: Internal
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().
Reviewed-by: Minwoo Im <minwoo.im.dev@xxxxxxxxx>
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 7e0c0b54d194..53f9df376cfb 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -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);
--
2.17.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|