fio: make gui status update in timely fashion
[fio.git] / backend.c
index 6e0e4424d6f6ce31d32ff6cf5d2ca77ba09111c2..52791040ff21384d283b2a09de3ff9718e19d866 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -30,6 +30,7 @@
 #include <locale.h>
 #include <assert.h>
 #include <time.h>
+#include <inttypes.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/ipc.h>
@@ -67,7 +68,7 @@ int temp_stall_ts;
 unsigned long done_secs = 0;
 
 #define PAGE_ALIGN(buf)        \
-       (char *) (((unsigned long) (buf) + page_mask) & ~page_mask)
+       (char *) (((uintptr_t) (buf) + page_mask) & ~page_mask)
 
 #define JOB_START_TIMEOUT      (5 * 1000)
 
@@ -408,6 +409,9 @@ static void do_verify(struct thread_data *td)
                        }
                }
 
+               if (flow_threshold_exceeded(td))
+                       continue;
+
                io_u = __get_io_u(td);
                if (!io_u)
                        break;
@@ -559,6 +563,9 @@ static void do_io(struct thread_data *td)
                        }
                }
 
+               if (flow_threshold_exceeded(td))
+                       continue;
+
                io_u = get_io_u(td);
                if (!io_u)
                        break;
@@ -1179,7 +1186,7 @@ err:
                write_iolog_close(td);
 
        td_set_runstate(td, TD_EXITED);
-       return (void *) (unsigned long) td->error;
+       return (void *) (uintptr_t) td->error;
 }
 
 
@@ -1210,7 +1217,7 @@ static int fork_main(int shmid, int offset)
        td = data + offset * sizeof(struct thread_data);
        ret = thread_main(td);
        shmdt(data);
-       return (int) (unsigned long) ret;
+       return (int) (uintptr_t) ret;
 }
 
 /*