Lines Matching defs:bio
13 #include <linux/bio.h>
86 * We need to keep track of which region a bio is doing io for.
93 static void store_io_and_region_in_bio(struct bio *bio, struct io *io,
101 bio->bi_private = (void *)((unsigned long)io | region);
104 static void retrieve_io_and_region_from_bio(struct bio *bio, struct io **io,
107 unsigned long val = (unsigned long)bio->bi_private;
142 static void endio(struct bio *bio)
148 if (bio->bi_status && bio_data_dir(bio) == READ)
149 zero_fill_bio(bio);
152 * The bio destructor in bio_put() may use the io object.
154 retrieve_io_and_region_from_bio(bio, &io, ®ion);
156 error = bio->bi_status;
157 bio_put(bio);
238 static void bio_dp_init(struct dpages *dp, struct bio *bio)
247 dp->context_ptr = bio->bi_io_vec;
248 dp->context_bi = bio->bi_iter;
310 struct bio *bio;
341 * Allocate a suitably sized-bio.
353 bio = bio_alloc_bioset(where->bdev, num_bvecs, opf, GFP_NOIO,
355 bio->bi_iter.bi_sector = where->sector + (where->count - remaining);
356 bio->bi_end_io = endio;
357 bio->bi_ioprio = ioprio;
358 store_io_and_region_in_bio(bio, io, region);
362 bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT;
371 if (!bio_add_page(bio, page, len, offset))
381 submit_bio(bio);
502 bio_dp_init(dp, io_req->mem.ptr.bio);