On 4/14/22 8:15 AM, Jasper Surmont wrote: > I'm writing a device mapper target, and on a bio (read) request I want > to access (for example just logging) the data that was just read (by > providing a callback to bio->bio_end_io). > > I've figured out I could read the data by using bvec_kmap_local() on > each bio_vec to get a pointer to the data. However, if my > understanding is correct this seems like an unefficient way: if the > bio just finished a read then shouldn't the data already be mapped > somewhere? If so, where? Not necessarily - if you're doing passthrough or O_DIRECT IO, then no mapping necessarily exists for any part of the IO. -- Jens Axboe