mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
block: get wp_offset by bdev_offset_from_zone_start
Call bdev_offset_from_zone_start() instead of open-coding it. Fixes: dd291d77cc90 ("block: Introduce zone write plugging") Signed-off-by: LongPing Wei <weilongping@oppo.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241107020439.1644577-1-weilongping@oppo.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
86e6ca55b8
commit
790eb09e59
@ -555,7 +555,7 @@ again:
|
|||||||
spin_lock_init(&zwplug->lock);
|
spin_lock_init(&zwplug->lock);
|
||||||
zwplug->flags = 0;
|
zwplug->flags = 0;
|
||||||
zwplug->zone_no = zno;
|
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);
|
bio_list_init(&zwplug->bio_list);
|
||||||
INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work);
|
INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work);
|
||||||
zwplug->disk = disk;
|
zwplug->disk = disk;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user