Lines Matching defs:bio
11 #include <linux/bio.h>
486 static void o2hb_bio_end_io(struct bio *bio)
488 struct o2hb_bio_wait_ctxt *wc = bio->bi_private;
490 if (bio->bi_status) {
491 mlog(ML_ERROR, "IO Error %d\n", bio->bi_status);
492 wc->wc_error = blk_status_to_errno(bio->bi_status);
496 bio_put(bio);
501 static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
511 struct bio *bio;
518 bio = bio_alloc(reg->hr_bdev, 16, opf, GFP_ATOMIC);
519 if (!bio) {
521 bio = ERR_PTR(-ENOMEM);
525 /* Must put everything in 512 byte sectors for the bio... */
526 bio->bi_iter.bi_sector = (reg->hr_start_block + cs) << (bits - 9);
527 bio->bi_private = wc;
528 bio->bi_end_io = o2hb_bio_end_io;
541 len = bio_add_page(bio, page, vec_len, vec_start);
550 return bio;
560 struct bio *bio;
565 bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots,
567 if (IS_ERR(bio)) {
568 status = PTR_ERR(bio);
574 submit_bio(bio);
592 struct bio *bio;
598 bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1,
600 if (IS_ERR(bio)) {
601 status = PTR_ERR(bio);
607 submit_bio(bio);