Lines Matching defs:bio
13 #include <linux/bio.h>
490 static void o2hb_bio_end_io(struct bio *bio)
492 struct o2hb_bio_wait_ctxt *wc = bio->bi_private;
494 if (bio->bi_status) {
495 mlog(ML_ERROR, "IO Error %d\n", bio->bi_status);
496 wc->wc_error = blk_status_to_errno(bio->bi_status);
500 bio_put(bio);
505 static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
516 struct bio *bio;
523 bio = bio_alloc(GFP_ATOMIC, 16);
524 if (!bio) {
526 bio = ERR_PTR(-ENOMEM);
530 /* Must put everything in 512 byte sectors for the bio... */
531 bio->bi_iter.bi_sector = (reg->hr_start_block + cs) << (bits - 9);
532 bio_set_dev(bio, reg->hr_bdev);
533 bio->bi_private = wc;
534 bio->bi_end_io = o2hb_bio_end_io;
535 bio_set_op_attrs(bio, op, op_flags);
548 len = bio_add_page(bio, page, vec_len, vec_start);
557 return bio;
567 struct bio *bio;
572 bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots,
574 if (IS_ERR(bio)) {
575 status = PTR_ERR(bio);
581 submit_bio(bio);
599 struct bio *bio;
605 bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1, REQ_OP_WRITE,
607 if (IS_ERR(bio)) {
608 status = PTR_ERR(bio);
614 submit_bio(bio);