Lines Matching refs:wc
355 static inline void o2hb_bio_wait_init(struct o2hb_bio_wait_ctxt *wc) in o2hb_bio_wait_init() argument
357 atomic_set(&wc->wc_num_reqs, 1); in o2hb_bio_wait_init()
358 init_completion(&wc->wc_io_complete); in o2hb_bio_wait_init()
359 wc->wc_error = 0; in o2hb_bio_wait_init()
363 static inline void o2hb_bio_wait_dec(struct o2hb_bio_wait_ctxt *wc, in o2hb_bio_wait_dec() argument
369 if (atomic_dec_and_test(&wc->wc_num_reqs)) { in o2hb_bio_wait_dec()
371 complete(&wc->wc_io_complete); in o2hb_bio_wait_dec()
377 struct o2hb_bio_wait_ctxt *wc) in o2hb_wait_on_io() argument
379 o2hb_bio_wait_dec(wc, 1); in o2hb_wait_on_io()
380 wait_for_completion(&wc->wc_io_complete); in o2hb_wait_on_io()
386 struct o2hb_bio_wait_ctxt *wc = bio->bi_private; in o2hb_bio_end_io() local
390 wc->wc_error = error; in o2hb_bio_end_io()
393 o2hb_bio_wait_dec(wc, 1); in o2hb_bio_end_io()
400 struct o2hb_bio_wait_ctxt *wc, in o2hb_setup_one_bio() argument
426 bio->bi_private = wc; in o2hb_setup_one_bio()
457 struct o2hb_bio_wait_ctxt wc; in o2hb_read_slots() local
460 o2hb_bio_wait_init(&wc); in o2hb_read_slots()
463 bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots); in o2hb_read_slots()
470 atomic_inc(&wc.wc_num_reqs); in o2hb_read_slots()
477 o2hb_wait_on_io(reg, &wc); in o2hb_read_slots()
478 if (wc.wc_error && !status) in o2hb_read_slots()
479 status = wc.wc_error; in o2hb_read_slots()