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/fio.h b/fio.h
index 934d897..b087f97 100644
--- a/fio.h
+++ b/fio.h
@@ -129,6 +129,14 @@
 	struct list_head list;
 };
 
+/*
+ * io_ops->queue() return values
+ */
+enum {
+	FIO_Q_COMPLETED	= 0,		/* completed sync */
+	FIO_Q_QUEUED	= 1,		/* queued, will complete async */
+};
+
 #define FIO_HDR_MAGIC	0xf00baaef
 
 enum {
@@ -608,6 +616,7 @@
 extern void put_io_u(struct thread_data *, struct io_u *);
 extern void ios_completed(struct thread_data *, struct io_completion_data *);
 extern void io_completed(struct thread_data *, struct io_u *, struct io_completion_data *);
+extern void init_icd(struct io_completion_data *);
 
 /*
  * io engine entry points
@@ -666,9 +675,10 @@
 	void (*cleanup)(struct thread_data *);
 	void *data;
 	void *dlhandle;
+	unsigned long priv;
 };
 
-#define FIO_IOOPS_VERSION	3
+#define FIO_IOOPS_VERSION	4
 
 extern struct ioengine_ops *load_ioengine(struct thread_data *, const char *);
 extern int register_ioengine(struct ioengine_ops *);