+/*
+ * Complete a single io_u for the sync engines.
+ */
+long io_u_sync_complete(struct thread_data *td, struct io_u *io_u,
+ endio_handler *handler)
+{
+ struct io_completion_data icd;
+
+ init_icd(&icd, handler, 1);
+ io_completed(td, io_u, &icd);
+ put_io_u(td, io_u);
+
+ if (!icd.error)
+ return icd.bytes_done[0] + icd.bytes_done[1];
+
+ return -1;
+}
+
+/*
+ * Called to complete min_events number of io for the async engines.
+ */
+long io_u_queued_complete(struct thread_data *td, int min_events,
+ endio_handler *handler)
+
+{
+ struct io_completion_data icd;
+ struct timespec *tvp = NULL;
+ int ret;
+
+ if (min_events > 0) {
+ ret = td_io_commit(td);
+ if (ret < 0) {
+ td_verror(td, -ret);
+ return ret;
+ }
+ } else {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, };