Fio 2.1.6.1
[fio.git] / libfio.c
index 7eb4576f7b1e35e2e1b0e3bf6baf0b6f7c3080ca..8eddab80b345651f11533038963bb03e5bc0ff93 100644 (file)
--- a/libfio.c
+++ b/libfio.c
@@ -85,7 +85,6 @@ static void reset_io_counters(struct thread_data *td)
                td->this_io_blocks[ddir] = 0;
                td->rate_bytes[ddir] = 0;
                td->rate_blocks[ddir] = 0;
-               td->io_issues[ddir] = 0;
        }
        td->zone_bytes = 0;
 
@@ -136,7 +135,7 @@ void reset_all_stats(struct thread_data *td)
        memcpy(&td->epoch, &tv, sizeof(tv));
        memcpy(&td->start, &tv, sizeof(tv));
 
-       lat_target_init(td);
+       lat_target_reset(td);
 }
 
 void reset_fio_state(void)
@@ -173,6 +172,19 @@ void td_set_runstate(struct thread_data *td, int runstate)
        td->runstate = runstate;
 }
 
+int td_bump_runstate(struct thread_data *td, int new_state)
+{
+       int old_state = td->runstate;
+
+       td_set_runstate(td, new_state);
+       return old_state;
+}
+
+void td_restore_runstate(struct thread_data *td, int old_state)
+{
+       td_set_runstate(td, old_state);
+}
+
 void fio_terminate_threads(int group_id)
 {
        struct thread_data *td;