linux/drivers/block/null_blk
Damien Le Moal 3bdde0701e null_blk: Do zone resource management only if necessary
For zoned null_blk devices setup without any limit on the maximum number
of open and active zones, there is no need to count the number of zones
that are implicitly open, explicitly open and closed. This is indicated
by the boolean field need_zone_res_mgmt of sturct nullb_device.

Modify the zone management functions null_reset_zone(),
null_finish_zone(), null_open_zone() and null_close_zone() to manage
the zone condition counters only if the device need_zone_res_mgmt field
is true. With this change, the function __null_close_zone() is removed
and integrated into the 2 caller sites directly, with the
null_close_imp_open_zone() call site greatly simplified as this function
closes zones that are known to be in the implicit open condition.

null_zone_write() is modified in a similar manner to do zone condition
accouting only when the device need_zone_res_mgmt field is true.

With these changes, the inline helpers null_lock_zone_res() and
null_unlock_zone_res() are removed and replaced with direct calls to
spin_lock()/spin_unlock().

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240411085502.728558-3-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-04-17 08:44:07 -06:00
..
Kconfig block: null_blk: make fault-injection dynamically configurable per device 2023-04-13 07:38:55 -06:00
main.c null_blk: Have all null_handle_xxx() return a blk_status_t 2024-04-17 08:44:07 -06:00
Makefile
null_blk.h null_blk: Introduce fua attribute 2024-04-17 08:44:03 -06:00
trace.c
trace.h null_blk: remove the bio based I/O path 2024-02-20 06:21:27 -07:00
zoned.c null_blk: Do zone resource management only if necessary 2024-04-17 08:44:07 -06:00