On Sun, Mar 29, 2020 at 5:05 PM Christoph Hellwig [off-list ref] wrote:
On Sat, Mar 28, 2020 at 09:16:55AM -0700, Bart Van Assche wrote:
quoted
There are more users in the Linux kernel of bio_add_pc_page() than only
bio_map_kern(), e.g. the SCSI target pass-through code
(drivers/target/target_core_pscsi.c). The code that uses bio_map_kern()
is in patch 22/26: "block/rnbd: server: functionality for IO submission
to file or block dev". Isn't that use case similar to the SCSI
pass-through code? I think the RNBD server code also implements storage
target functionality.
No, it is not at all. The RNBD case submits normal read/write bios, for
which bio_map_kerl is the wrong interfac given that it
uses bio_add_pc_page. Read, write and other non-passthrough requests
must use bio_add_page instead.
Thanks for comments, Christoph.
If I understood you correctly, so the right way is to construct bio
similar to bio_map_kern, but we have to use bio_add_page instead of
bio_add_pc_page?
As mentioned by Bart also Chaitanya, looks it's reasonable to add a
helper for normal READ|WRITE operation to map and submit bio from the
data buffer,
but sure can be done later.
Thanks!