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>