Fix min/max typeof warnings
[fio.git] / init.c
diff --git a/init.c b/init.c
index b4a0cbb91f9c3ce3c01b1db9b5f3b8fa33f5e22f..5b0290d051f743ef1552d2635e1f171a619b5f8a 100644 (file)
--- a/init.c
+++ b/init.c
@@ -380,6 +380,7 @@ static struct thread_data *get_new_job(int global, struct thread_data *parent,
        profile_add_hooks(td);
 
        td->thread_number = thread_number;
+       td->subjob_number = 0;
 
        if (jobname)
                td->o.name = strdup(jobname);
@@ -835,7 +836,9 @@ static void td_fill_rand_seeds_internal(struct thread_data *td)
 void td_fill_rand_seeds(struct thread_data *td)
 {
        if (td->o.allrand_repeatable) {
-               for (int i = 0; i < FIO_RAND_NR_OFFS; i++)
+               unsigned int i;
+
+               for (i = 0; i < FIO_RAND_NR_OFFS; i++)
                        td->rand_seeds[i] = FIO_RANDSEED * td->thread_number
                                + i;
        }
@@ -846,6 +849,9 @@ void td_fill_rand_seeds(struct thread_data *td)
                td_fill_rand_seeds_internal(td);
 
        init_rand_seed(&td->buf_state, td->rand_seeds[FIO_RAND_BUF_OFF]);
+       frand_copy(&td->buf_state_prev, &td->buf_state);
+
+       init_rand_seed(&td->dedupe_state, td->rand_seeds[FIO_DEDUPE_OFF]);
 }
 
 /*
@@ -1288,6 +1294,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
                td_new->o.numjobs = 1;
                td_new->o.stonewall = 0;
                td_new->o.new_group = 0;
+               td_new->subjob_number = numjobs;
 
                if (file_alloced) {
                        if (td_new->files) {