zbd: move zone finish operation to zbd_convert_to_write_zone()
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 14 Apr 2025 06:27:18 +0000 (15:27 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 14 Apr 2025 14:27:31 +0000 (08:27 -0600)
commit2a87f2690c5fe8f3b2097e626abaed6e53a1c476
tree518416e305654170396abe4c2bbc1f0469c5cb4b
parentf18c2fd5f3e8114b5bfbe04e5511421c24b25fe1
zbd: move zone finish operation to zbd_convert_to_write_zone()

Currently, when a write target zone has fewer remainder sectors than
the block size, fio finishes the zone to make the zone inactive (not
open), so that another zone can be open and used as a write target zone.
This zone finish operation is implemented in zbd_adjust_block().
However, this placement is less ideal because zbd_adjust_block() manages
not just write requests but also read and trim requests.

Since the zone finish operation is exclusively necessary for write
requests, implement it into zbd_convert_to_write_zone(). While at it,
improve the function comment.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250414062721.87641-2-shinichiro.kawasaki@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c