Lines Matching refs:bio
230 static void hib_end_io(struct bio *bio) in hib_end_io() argument
232 struct hib_bio_batch *hb = bio->bi_private; in hib_end_io()
233 struct page *page = bio->bi_io_vec[0].bv_page; in hib_end_io()
235 if (bio->bi_error) { in hib_end_io()
237 imajor(bio->bi_bdev->bd_inode), in hib_end_io()
238 iminor(bio->bi_bdev->bd_inode), in hib_end_io()
239 (unsigned long long)bio->bi_iter.bi_sector); in hib_end_io()
242 if (bio_data_dir(bio) == WRITE) in hib_end_io()
245 if (bio->bi_error && !hb->error) in hib_end_io()
246 hb->error = bio->bi_error; in hib_end_io()
250 bio_put(bio); in hib_end_io()
257 struct bio *bio; in hib_submit_io() local
260 bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1); in hib_submit_io()
261 bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); in hib_submit_io()
262 bio->bi_bdev = hib_resume_bdev; in hib_submit_io()
264 if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { in hib_submit_io()
266 (unsigned long long)bio->bi_iter.bi_sector); in hib_submit_io()
267 bio_put(bio); in hib_submit_io()
272 bio->bi_end_io = hib_end_io; in hib_submit_io()
273 bio->bi_private = hb; in hib_submit_io()
275 submit_bio(rw, bio); in hib_submit_io()
277 error = submit_bio_wait(rw, bio); in hib_submit_io()
278 bio_put(bio); in hib_submit_io()