Skip to content

Commit

Permalink
block: get wp_offset by bdev_offset_from_zone_start
Browse files Browse the repository at this point in the history
Call bdev_offset_from_zone_start() instead of open-coding it.

Fixes: dd291d7 ("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>
  • Loading branch information
LongPing Wei authored and Jens Axboe committed Dec 10, 2024
1 parent 86e6ca5 commit 790eb09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-zoned.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,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;
Expand Down

0 comments on commit 790eb09

Please sign in to comment.