Lines Matching defs:hb

233 static void hib_init_batch(struct hib_bio_batch *hb)
235 atomic_set(&hb->count, 0);
236 init_waitqueue_head(&hb->wait);
237 hb->error = BLK_STS_OK;
238 blk_start_plug(&hb->plug);
241 static void hib_finish_batch(struct hib_bio_batch *hb)
243 blk_finish_plug(&hb->plug);
248 struct hib_bio_batch *hb = bio->bi_private;
263 if (bio->bi_status && !hb->error)
264 hb->error = bio->bi_status;
265 if (atomic_dec_and_test(&hb->count))
266 wake_up(&hb->wait);
278 struct hib_bio_batch *hb)
287 bio->bi_private = hb;
288 atomic_inc(&hb->count);
293 static int hib_wait_io(struct hib_bio_batch *hb)
299 wait_event(hb->wait, atomic_read(&hb->count) == 0);
300 return blk_status_to_errno(hb->error);
369 * @hb: bio completion batch
372 static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb)
381 if (!hb)
386 ret = hib_wait_io(hb); /* Free pages */
395 return hib_submit_io_async(REQ_OP_WRITE | REQ_SYNC, offset, src, hb);
439 struct hib_bio_batch *hb)
447 error = write_page(buf, offset, hb);
456 error = write_page(handle->cur, handle->cur_swap, hb);
463 if (hb && low_free_pages() <= handle->reqd_free_pages) {
464 error = hib_wait_io(hb);
541 struct hib_bio_batch hb;
545 hib_init_batch(&hb);
558 ret = swap_write_page(handle, data_of(*snapshot), &hb);
566 err2 = hib_wait_io(&hb);
567 hib_finish_batch(&hb);
688 struct hib_bio_batch hb;
697 hib_init_batch(&hb);
865 ret = swap_write_page(handle, page, &hb);
876 err2 = hib_wait_io(&hb);
887 hib_finish_batch(&hb);
1042 struct hib_bio_batch *hb)
1053 if (hb)
1054 error = hib_submit_io_async(REQ_OP_READ, offset, buf, hb);
1094 struct hib_bio_batch hb;
1098 hib_init_batch(&hb);
1111 ret = swap_read_page(handle, data_of(*snapshot), &hb);
1115 ret = hib_wait_io(&hb);
1123 err2 = hib_wait_io(&hb);
1124 hib_finish_batch(&hb);
1206 struct hib_bio_batch hb;
1219 hib_init_batch(&hb);
1349 ret = swap_read_page(handle, page[ring], &hb);
1376 ret = hib_wait_io(&hb);
1430 ret = hib_wait_io(&hb);
1506 hib_finish_batch(&hb);