ublk: grab request reference when the request is handled by userspace
authorMing Lei <ming.lei@redhat.com>
Fri, 19 May 2023 06:50:27 +0000 (14:50 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 20 May 2023 01:59:17 +0000 (19:59 -0600)
commit8284066946e6d9cc979566ce698fe24e7ca0b31e
treeac22ce70417d36d0b22edf5abd2ac8a065b0a9e9
parent981f95a571e3ca20a496c0b77dbf6b06039c6648
ublk: grab request reference when the request is handled by userspace

Add one reference counter into request pdu data, and hold this reference
in the request's lifetime.

Prepare for supporting to move request data copy into userspace, which
needs to copy request data by read()/write() on /dev/ublkcN, so we have
to guarantee that read()/write() is done on one valid/active request,
and that will be enhanced by holding the io request reference in
read()/write().

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230519065030.351216-5-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c