- rc = cl_io_submit_rw(env, io, rw == READ ? CRT_READ : CRT_WRITE,
- queue, CRP_NORMAL);
- if (rc == 0) {
- /*
- * If some pages weren't sent for any reason (e.g.,
- * direct-io read found up-to-date pages in the
- * cache), count them as completed to avoid infinite
- * wait.
- */
- cl_page_list_for_each(clp, &queue->c2_qin)
- cl_sync_io_note(anchor, +1);
- /* wait for the IO to be finished. */
- rc = cl_sync_io_wait(env, io, &queue->c2_qout,
- anchor) ?: pv->ldp_size;
- }
+ rc = cl_io_submit_sync(env, io,
+ rw == READ ? CRT_READ : CRT_WRITE,
+ queue, CRP_NORMAL, 0);
+ if (rc == 0)
+ rc = pv->ldp_size;