block: get wp_offset by bdev_offset_from_zone_start
Subsystems (2)
PATCH v4 1/1 block: get wp_offset by bdev_offset_from_zone_start
Call bdev_offset_from_zone_start() instead of open-coding it.
---
v4: update commit message
--- block/blk-zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-zoned.c +1 -1
@@ -537,7 +537,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk,spin_lock_init (&zwplug->lock); zwplug->flags =0 ; zwplug->zone_no = zno; - zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors -1 ); + zwplug->wp_offset =bdev_offset_from_zone_start (disk->part0, sector);bio_list_init (&zwplug->bio_list);INIT_WORK (&zwplug->bio_work, blk_zone_wplug_bio_work); zwplug->disk = disk;
Signature · 1 line
2.34.1
Quoted 3 lines · LongPing Wei
Call
bdev_offset_from_zone_start()instead of open-coding it.Fixes dd291d77cc90 ("block: Introduce zone write plugging")
This is not a bug fix so the "Fixes:" tag probably should be left out. Anyway:
Quoted 16 lines · LongPing Wei
Call
bdev_offset_from_zone_start()instead of open-coding it.Fixes dd291d77cc90 ("block: Introduce zone write plugging")Signed-off-by LongPing Wei <[email protected]>Reviewed-by Damien Le Moal <[email protected]>---
v4: update commit message--- block/blk-zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/blk-zoned.c +0
-0
block/blk-zoned.c static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk, · line 543
Quoted 8 lines
block/blk-zoned.c +1
-1@@ -537,7 +537,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk,spin_lock_init (&zwplug->lock); zwplug->flags =0 ; zwplug->zone_no = zno; - zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors -1 ); + zwplug->wp_offset =bdev_offset_from_zone_start (disk->part0, sector);bio_list_init (&zwplug->bio_list);INIT_WORK (&zwplug->bio_work, blk_zone_wplug_bio_work); zwplug->disk = disk;
Hi LongPing Wei,
Since this patch has not yet been merged, how about reposting it?
Thanks,
Bart.
Jens Axboe
maintainerQuoted 28 lines · Bart Van Assche
Quoted 16 lines · LongPing Wei
Call
bdev_offset_from_zone_start()instead of open-coding it.Fixes dd291d77cc90 ("block: Introduce zone write plugging")Signed-off-by LongPing Wei <[email protected]>Reviewed-by Damien Le Moal <[email protected]>---
v4: update commit message
---
block/blk-zoned.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)block/blk-zoned.c +0
-0block/blk-zoned.c static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk, · line 543
Quoted 8 lines
block/blk-zoned.c +1
-1@@ -537,7 +537,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk, spin_lock_init(&zwplug->lock); zwplug->flags = 0; zwplug->zone_no = zno; - zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors - 1); + zwplug->wp_offset = bdev_offset_from_zone_start(disk->part0, sector); bio_list_init(&zwplug->bio_list); INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work); zwplug->disk = disk;Hi LongPing Wei,
Quoted 1 line
Since this patch has not yet been merged, how about reposting it?
No need, bubbled to the top and I got it applied.
Signature · 1 line
Jens Axboe
Quoted 3 lines · LongPing Wei
Call
bdev_offset_from_zone_start()instead of open-coding it.
Applied, thanks!
[1/1] block: get wp_offset by bdev_offset_from_zone_start
commit: 790eb09e59709a1ffc1c64fe4aae2789120851b0
Best regards,
Signature · 1 line
Jens Axboe