Scramble fix
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 9c1bed379df586ba8f3efea187aaaf319ce2d387..b492889f740b1745922fe2fb0a2388b73d91f7b2 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -874,9 +874,9 @@ static int init_io_u(struct thread_data *td)
                        io_u->buf = p + max_bs * i;
                        dprint(FD_MEM, "io_u %p, mem %p\n", io_u, io_u->buf);
 
-                       if (td_write(td) && !td->o.refill_buffers)
+                       if (td_write(td))
                                io_u_fill_buffer(td, io_u, max_bs);
-                       else if (td_write(td) && td->o.verify_pattern_bytes) {
+                       if (td_write(td) && td->o.verify_pattern_bytes) {
                                /*
                                 * Fill the buffer with the pattern if we are
                                 * going to be doing writes.
@@ -1502,10 +1502,8 @@ static void run_threads(void)
        for_each_td(td, i) {
                print_status_init(td->thread_number - 1);
 
-               if (!td->o.create_serialize) {
-                       init_disk_util(td);
+               if (!td->o.create_serialize)
                        continue;
-               }
 
                /*
                 * do file setup here so it happens sequentially,
@@ -1533,8 +1531,6 @@ static void run_threads(void)
                                        td_io_close_file(td, f);
                        }
                }
-
-               init_disk_util(td);
        }
 
        set_genesis_time();
@@ -1573,6 +1569,8 @@ static void run_threads(void)
                                break;
                        }
 
+                       init_disk_util(td);
+
                        /*
                         * Set state to created. Thread will transition
                         * to TD_INITIALIZED when it's done setting up.
@@ -1699,7 +1697,6 @@ int main(int argc, char *argv[], char *envp[])
        arch_init(envp);
 
        sinit();
-       init_rand(&__fio_rand_state);
 
        /*
         * We need locale for number printing, if it isn't set then just