- rc = cl_io_submit_rw(env, io,
- io->ci_type == CIT_READ ? CRT_READ :
- CRT_WRITE,
- queue);
- if (rc == 0) {
- /* If some pages weren't sent for any reason, count
- * then as completed, to avoid infinite wait. */
- cl_page_list_for_each(clp, &queue->c2_qin) {
- CL_PAGE_DEBUG(D_ERROR, env, clp,
- "not completed\n");
- cl_sync_io_note(anchor, +1);
- }
- /* wait for the IO to be finished. */
- rc = cl_sync_io_wait(env, io, &queue->c2_qout, anchor);
- }
+ enum cl_req_type iot;
+ iot = io->ci_type == CIT_READ ? CRT_READ : CRT_WRITE;
+ rc = cl_io_submit_sync(env, io, iot, queue, 0);