Introduce the io_u.post_submit callback function pointer
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index e050d9f7c775e7f4fabe10b80f9add5d87f8e510..29a360a95424a72cbf1c7f0c0b753efdbcf06f18 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -761,6 +761,11 @@ void put_file_log(struct thread_data *td, struct fio_file *f)
 
 void put_io_u(struct thread_data *td, struct io_u *io_u)
 {
+       if (io_u->post_submit) {
+               io_u->post_submit(io_u, io_u->error == 0);
+               io_u->post_submit = NULL;
+       }
+
        if (td->parent)
                td = td->parent;
 
@@ -1304,6 +1309,11 @@ static long set_io_u_file(struct thread_data *td, struct io_u *io_u)
                if (!fill_io_u(td, io_u))
                        break;
 
+               if (io_u->post_submit) {
+                       io_u->post_submit(io_u, false);
+                       io_u->post_submit = NULL;
+               }
+
                put_file_log(td, f);
                td_io_close_file(td, f);
                io_u->file = NULL;