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