Lines Matching refs: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);
272 struct hib_bio_batch *hb)
289 if (hb) {
291 bio->bi_private = hb;
292 atomic_inc(&hb->count);
302 static int hib_wait_io(struct hib_bio_batch *hb)
308 wait_event(hb->wait, atomic_read(&hb->count) == 0);
309 return blk_status_to_errno(hb->error);
382 * @hb: bio completion batch
385 static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb)
393 if (hb) {
399 ret = hib_wait_io(hb); /* Free pages */
409 hb = NULL; /* Go synchronous */
416 return hib_submit_io(REQ_OP_WRITE | REQ_SYNC, offset, src, hb);
458 struct hib_bio_batch *hb)
466 error = write_page(buf, offset, hb);
475 error = write_page(handle->cur, handle->cur_swap, hb);
482 if (hb && low_free_pages() <= handle->reqd_free_pages) {
483 error = hib_wait_io(hb);
560 struct hib_bio_batch hb;
564 hib_init_batch(&hb);
577 ret = swap_write_page(handle, data_of(*snapshot), &hb);
585 err2 = hib_wait_io(&hb);
586 hib_finish_batch(&hb);
705 struct hib_bio_batch hb;
714 hib_init_batch(&hb);
875 ret = swap_write_page(handle, page, &hb);
886 err2 = hib_wait_io(&hb);
897 hib_finish_batch(&hb);
1052 struct hib_bio_batch *hb)
1063 error = hib_submit_io(REQ_OP_READ, offset, buf, hb);
1101 struct hib_bio_batch hb;
1105 hib_init_batch(&hb);
1118 ret = swap_read_page(handle, data_of(*snapshot), &hb);
1122 ret = hib_wait_io(&hb);
1130 err2 = hib_wait_io(&hb);
1131 hib_finish_batch(&hb);
1210 struct hib_bio_batch hb;
1223 hib_init_batch(&hb);
1346 ret = swap_read_page(handle, page[ring], &hb);
1373 ret = hib_wait_io(&hb);
1427 ret = hib_wait_io(&hb);
1503 hib_finish_batch(&hb);