Change IO engine queuing

Instead of always pretending to be async, let the IO engines
return FIO_Q_COMPLETED or FIO_Q_QUEUED to signal async or
sync completions regardless of their nature. This cleans up
the queuing model quite a bit.

Also fixed a verification error spotted while doing this
transformation.

The main intent of this is to allow queuing more than 1 piece
of IO at the time, that will come in a later changeset.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/ioengines.c b/ioengines.c
index 2ed2749..1b510df 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -33,16 +33,27 @@
 	if (ops->flags & FIO_CPUIO)
 		return 0;
 
+	if (!ops->queue) {
+		log_err("%s: no queue handler\n", ops->name);
+		return 1;
+	}
+
+	/*
+	 * sync engines only need a ->queue()
+	 */
+	if (ops->flags & FIO_SYNCIO)
+		return 0;
+	
 	if (!ops->event) {
-		log_err("%s: no event handler)\n", ops->name);
+		log_err("%s: no event handler\n", ops->name);
 		return 1;
 	}
 	if (!ops->getevents) {
-		log_err("%s: no getevents handler)\n", ops->name);
+		log_err("%s: no getevents handler\n", ops->name);
 		return 1;
 	}
 	if (!ops->queue) {
-		log_err("%s: no queue handler)\n", ops->name);
+		log_err("%s: no queue handler\n", ops->name);
 		return 1;
 	}
 		
@@ -159,8 +170,8 @@
 
 int td_io_prep(struct thread_data *td, struct io_u *io_u)
 {
-	if (td->io_ops->prep && td->io_ops->prep(td, io_u))
-		return 1;
+	if (td->io_ops->prep)
+		return td->io_ops->prep(td, io_u);
 
 	return 0;
 }
@@ -168,7 +179,10 @@
 int td_io_getevents(struct thread_data *td, int min, int max,
 		    struct timespec *t)
 {
-	return td->io_ops->getevents(td, min, max, t);
+	if (td->io_ops->getevents)
+		return td->io_ops->getevents(td, min, max, t);
+
+	return 0;
 }
 
 int td_io_queue(struct thread_data *td, struct io_u *io_u)