The only user in your final tree seems to be the loop driver, and
even that one only uses the helper for read/write bios.
I think something like this would be much simpler in the end:
The recently submitted nvme-tcp host driver should also be a user
of this. Does it make sense to keep it as a helper then?
I did take a brief look at the code, and I really don't understand
why the heck it even deals with bios to start with. Like all the
other nvme transports it is a blk-mq driver and should iterate
over segments in a request and more or less ignore bios. Something
is horribly wrong in the design.
Can you explain a little more? I'm more than happy to change that but
I'm not completely clear how...
Before we begin a data transfer, we need to set our own iterator that
will advance with the progression of the data transfer. We also need to
keep in mind that all the data transfer (both send and recv) are
completely non blocking (and zero-copy when we send).
That means that every data movement needs to be able to suspend
and resume asynchronously. i.e. we cannot use the following pattern:
rq_for_each_segment(bvec, rq, rq_iter) {
iov_iter_bvec(&iov_iter, WRITE, &bvec, 1, bvec.bv_len);
send(sock, iov_iter);
}
Given that a request can hold more than a single bio, I'm not clear on
how we can achieve that without iterating over the bios in the request
ourselves.
Any useful insight?