Merge branch 'master' of ssh://git.kernel.dk/data/git/fio
authorJens Axboe <axboe@fb.com>
Fri, 8 May 2015 15:21:17 +0000 (09:21 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 8 May 2015 15:21:17 +0000 (09:21 -0600)
HOWTO
init.c
options.c

diff --git a/HOWTO b/HOWTO
index 0808cc3a07e0f53a62c3476b6789f47426917829..d62d4089fb9d633892e60290f0917530c9411f5b 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -435,6 +435,7 @@ unified_rw_reporting=bool   Fio normally reports statistics on a per
 
 randrepeat=bool        For random IO workloads, seed the generator in a predictable
                way so that results are repeatable across repetitions.
+               Defaults to true.
 
 randseed=int   Seed the random number generators based on this seed value, to
                be able to control what sequence of output is being generated.
diff --git a/init.c b/init.c
index fa50d3c61b9e7af4680ab6dceec53b214cd3d4d6..ba5bf2fbf4bb9b55bc61267e7ff0e3e8889bbd04 100644 (file)
--- a/init.c
+++ b/init.c
@@ -749,7 +749,7 @@ static int fixup_options(struct thread_data *td)
        /*
         * If randseed is set, that overrides randrepeat
         */
-       if (td->o.rand_seed)
+       if (fio_option_is_set(&td->o, rand_seed))
                td->o.rand_repeatable = 0;
 
        if ((td->io_ops->flags & FIO_NOEXTEND) && td->o.file_append) {
@@ -966,14 +966,10 @@ static int setup_random_seeds(struct thread_data *td)
        unsigned long seed;
        unsigned int i;
 
-       if (!td->o.rand_repeatable && !td->o.rand_seed)
+       if (!td->o.rand_repeatable && !fio_option_is_set(&td->o, rand_seed))
                return init_random_state(td, td->rand_seeds, sizeof(td->rand_seeds));
 
-       if (!td->o.rand_seed)
-               seed = 0x89;
-       else
-               seed = td->o.rand_seed;
-
+       seed = td->o.rand_seed;
        for (i = 0; i < 4; i++)
                seed *= 0x9e370001UL;
 
index f21ed260d0277ed25286b7dd3e3b98fbca653a17..e306b28b6c08398c139f162b309523ec6f990c63 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1845,6 +1845,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .type   = FIO_OPT_STR_VAL,
                .off1   = td_var_offset(rand_seed),
                .help   = "Set the random generator seed value",
+               .def    = "0x89",
                .parent = "rw",
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_RANDOM,