[PATCH] Support for multiple queued commands with read/write SG v3 io
diff --git a/fio.c b/fio.c
index 5c45cae..43942dd 100644
--- a/fio.c
+++ b/fio.c
@@ -579,7 +579,7 @@
 	return 0;
 }
 
-static void put_io_u(struct thread_data *td, struct io_u *io_u)
+void put_io_u(struct thread_data *td, struct io_u *io_u)
 {
 	list_del(&io_u->list);
 	list_add(&io_u->list, &td->io_u_freelist);
@@ -588,7 +588,7 @@
 
 #define queue_full(td)	(list_empty(&(td)->io_u_freelist))
 
-static struct io_u *__get_io_u(struct thread_data *td)
+struct io_u *__get_io_u(struct thread_data *td)
 {
 	struct io_u *io_u;
 
@@ -1113,6 +1113,7 @@
 		INIT_LIST_HEAD(&io_u->list);
 
 		io_u->buf = p + td->max_bs * i;
+		io_u->index = i;
 		list_add(&io_u->list, &td->io_u_freelist);
 	}