loop: cleanup lo_rw_aio()
authorMing Lei <ming.lei@redhat.com>
Sat, 22 Mar 2025 01:26:11 +0000 (09:26 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 22 Mar 2025 17:39:45 +0000 (11:39 -0600)
commit832c9fec8e2314170c5451023565b94f05477aa7
tree1747a23c3c00a4c9bcf584e3a5b1d62163d931de
parent04dcb8a909b5b68464ec5ccb123e9614f3ac333d
loop: cleanup lo_rw_aio()

Cleanup lo_rw_aio() a bit by refactoring it into three parts:

- lo_cmd_nr_bvec(), for calculating how many bvecs in this request

- lo_rw_aio_prep(), for preparing loop command, which need to be called
once

- lo_submit_rw_aio(), for submitting this lo command, which can be
called multiple times

Prepare for trying to handle loop command by NOWAIT read/write IO
first.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250322012617.354222-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c