Lines Matching refs:bio
238 static void hib_end_io(struct bio *bio) in hib_end_io() argument
240 struct hib_bio_batch *hb = bio->bi_private; in hib_end_io()
241 struct page *page = bio_first_page_all(bio); in hib_end_io()
243 if (bio->bi_status) { in hib_end_io()
245 MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), in hib_end_io()
246 (unsigned long long)bio->bi_iter.bi_sector); in hib_end_io()
249 if (bio_data_dir(bio) == WRITE) in hib_end_io()
255 if (bio->bi_status && !hb->error) in hib_end_io()
256 hb->error = bio->bi_status; in hib_end_io()
260 bio_put(bio); in hib_end_io()
267 struct bio *bio; in hib_submit_io() local
270 bio = bio_alloc(GFP_NOIO | __GFP_HIGH, 1); in hib_submit_io()
271 bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); in hib_submit_io()
272 bio_set_dev(bio, hib_resume_bdev); in hib_submit_io()
273 bio_set_op_attrs(bio, op, op_flags); in hib_submit_io()
275 if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { in hib_submit_io()
277 (unsigned long long)bio->bi_iter.bi_sector); in hib_submit_io()
278 bio_put(bio); in hib_submit_io()
283 bio->bi_end_io = hib_end_io; in hib_submit_io()
284 bio->bi_private = hb; in hib_submit_io()
286 submit_bio(bio); in hib_submit_io()
288 error = submit_bio_wait(bio); in hib_submit_io()
289 bio_put(bio); in hib_submit_io()