On Sun, Mar 29, 2020 at 06:08:31PM +0000, Chaitanya Kulkarni wrote: > > 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. > > > > Since rw are most common operations, it'd be nice to have a helper > function for REQ_OP_[READ|WRITE] to map and submit bio from data buffer > with chaining to avoid code duplication in each driver which based on > the bio_add_page(). > > I'd be happy to send a patch for that if that is acceptable. Well, there aren't a whole lot of driver submitting bios - it's mostly file systems, and those often use shared code and/or have very specific requirements. I've started to factor some reasonably common code into self-contained helpers with recent XFS work: xlog_map_iclog_data and xfs_rw_bdev. Both could probably move to the block layer with a little more work, but we'll have to be careful and actually find enough suitable users.