null_blk: Simplify null_zone_write()
authorDamien Le Moal <dlemoal@kernel.org>
Thu, 11 Apr 2024 08:55:02 +0000 (17:55 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 17 Apr 2024 14:44:07 +0000 (08:44 -0600)
commite994ff5b55e3bf30ecb6ed354eaec77c989aa4ae
treec44200859a82ddead58fc5a16ef04814755bbc05
parent3bdde0701e5f819df0fa0e32fa8d5df7dc184cb5
null_blk: Simplify null_zone_write()

In null_zone_write, we do not need to first check if the target zone
condition is FULL, READONLY or OFFLINE: for theses conditions, the check
of the command sector against the zone write pointer will always result
in the command failing. Remove these checks.

We still however need to check that the target zone write pointer is not
invalid for zone append operations. To do so, add the macro
NULL_ZONE_INVALID_WP and use it in null_set_zone_cond() when changing a
zone to READONLY or OFFLINE condition.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20240411085502.728558-4-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk/zoned.c