|
Move the ublk_ctrl_*() helpers and ublk_setup_ring() out of kublk.c,
so a small test program can send control commands without copying
them. kublk still links every *.c file, ctrl.c included.
ublk_ctrl_deinit() now also exits the control ring, and ublk_ctrl_init()
checks the allocation and closes /dev/ublk-control when the ring setup
fails. kublk calls them only around its own lifetime, but a test which
opens a control handle per thread must not leak.
No functional change for kublk.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Tested-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261011063555.1142277-10-tom.leiming@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|