Thanks for the answer, @ctuffli. I decided to use a structure similar to that described here . Basically, I struct packet_data that will contain pointers to all struct bio that must be combined to form one single struct bio (and later one, one struct request ). In addition, I store some information about the drivers, as well as this struct packet_data . Then I highlight the new struct bio (lets call it "merged_bio"), copy all the pages from the list of source merged_bio->bi_private and then make merged_bio->bi_private pointer to struct packet_data . This last hack will allow me to keep track of the source BIO list, and also call bio_endio() to complete the I / O for all individual merged_bio after the successful merged_bio transfer.
Not sure if this is the smartest way to do this, but it does what I intended !: ^)
source share