Lines Matching refs:wc
348 static inline void o2hb_bio_wait_init(struct o2hb_bio_wait_ctxt *wc) in o2hb_bio_wait_init() argument
350 atomic_set(&wc->wc_num_reqs, 1); in o2hb_bio_wait_init()
351 init_completion(&wc->wc_io_complete); in o2hb_bio_wait_init()
352 wc->wc_error = 0; in o2hb_bio_wait_init()
356 static inline void o2hb_bio_wait_dec(struct o2hb_bio_wait_ctxt *wc, in o2hb_bio_wait_dec() argument
362 if (atomic_dec_and_test(&wc->wc_num_reqs)) { in o2hb_bio_wait_dec()
364 complete(&wc->wc_io_complete); in o2hb_bio_wait_dec()
370 struct o2hb_bio_wait_ctxt *wc) in o2hb_wait_on_io() argument
372 o2hb_bio_wait_dec(wc, 1); in o2hb_wait_on_io()
373 wait_for_completion(&wc->wc_io_complete); in o2hb_wait_on_io()
378 struct o2hb_bio_wait_ctxt *wc = bio->bi_private; in o2hb_bio_end_io() local
382 wc->wc_error = bio->bi_error; in o2hb_bio_end_io()
385 o2hb_bio_wait_dec(wc, 1); in o2hb_bio_end_io()
392 struct o2hb_bio_wait_ctxt *wc, in o2hb_setup_one_bio() argument
418 bio->bi_private = wc; in o2hb_setup_one_bio()
449 struct o2hb_bio_wait_ctxt wc; in o2hb_read_slots() local
452 o2hb_bio_wait_init(&wc); in o2hb_read_slots()
455 bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots); in o2hb_read_slots()
462 atomic_inc(&wc.wc_num_reqs); in o2hb_read_slots()
469 o2hb_wait_on_io(reg, &wc); in o2hb_read_slots()
470 if (wc.wc_error && !status) in o2hb_read_slots()
471 status = wc.wc_error; in o2hb_read_slots()