Skip to content

Commit 790eb09

Browse files
LongPing Weiaxboe
authored andcommitted
block: get wp_offset by bdev_offset_from_zone_start
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>
1 parent 86e6ca5 commit 790eb09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-zoned.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk,
555555
spin_lock_init(&zwplug->lock);
556556
zwplug->flags = 0;
557557
zwplug->zone_no = zno;
558-
zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors - 1);
558+
zwplug->wp_offset = bdev_offset_from_zone_start(disk->part0, sector);
559559
bio_list_init(&zwplug->bio_list);
560560
INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work);
561561
zwplug->disk = disk;

0 commit comments

Comments
 (0)