fio: consolidate rand_seed to uint64_t
authorGrant Grundler <grundler@chromium.org>
Tue, 28 Jan 2014 22:11:23 +0000 (15:11 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Jan 2014 22:11:23 +0000 (15:11 -0700)
csscope showed rand_seed was defined 4 times - each a different type.
While they are used differently, the places where they overlap
should reference the same type. This patch makes three of them the same
as suggested by Jens Axboe.

Signed-off-by: Grant Grundler <grundler@chromium.org>
Updated by me to change rand_seed option to unsigned long long
and changes related to that.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
cconv.c
ioengine.h
options.c
thread_options.h

diff --git a/cconv.c b/cconv.c
index 3f41ae46c0bda6fc1474f65a2e02204dbe189fae..0d30f07d9afec245c8a48282705bd61a60749c5f 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -119,7 +119,7 @@ void convert_thread_options_to_cpu(struct thread_options *o,
        o->do_disk_util = le32_to_cpu(top->do_disk_util);
        o->override_sync = le32_to_cpu(top->override_sync);
        o->rand_repeatable = le32_to_cpu(top->rand_repeatable);
-       o->rand_seed = le32_to_cpu(top->rand_seed);
+       o->rand_seed = le64_to_cpu(top->rand_seed);
        o->use_os_rand = le32_to_cpu(top->use_os_rand);
        o->log_avg_msec = le32_to_cpu(top->log_avg_msec);
        o->norandommap = le32_to_cpu(top->norandommap);
@@ -285,7 +285,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        top->do_disk_util = cpu_to_le32(o->do_disk_util);
        top->override_sync = cpu_to_le32(o->override_sync);
        top->rand_repeatable = cpu_to_le32(o->rand_repeatable);
-       top->rand_seed = cpu_to_le32(o->rand_seed);
+       top->rand_seed = __cpu_to_le64(o->rand_seed);
        top->use_os_rand = cpu_to_le32(o->use_os_rand);
        top->log_avg_msec = cpu_to_le32(o->log_avg_msec);
        top->norandommap = cpu_to_le32(o->norandommap);
index 949af9150613c8b398f389fee71c0cfa65b692e7..0756bc7e6c1335dc729bbe6c08b9f78630121d66 100644 (file)
@@ -56,7 +56,7 @@ struct io_u {
        /*
         * Initial seed for generating the buffer contents
         */
-       unsigned long rand_seed;
+       uint64_t rand_seed;
 
        /*
         * IO engine state, may be different from above when we get
index 525d31840c5e7f55944f2acec3210973de581057..82870112b06df1532e0b5607f444259942bbb892 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1656,7 +1656,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
        {
                .name   = "randseed",
                .lname  = "The random generator seed",
-               .type   = FIO_OPT_INT,
+               .type   = FIO_OPT_STR_VAL,
                .off1   = td_var_offset(rand_seed),
                .help   = "Set the random generator seed value",
                .parent = "rw",
index 2f807cd788b1ac154e67df4840efe71a5e72087a..79c3a89247876254a83d6adf8c9595a29cdffd3a 100644 (file)
@@ -100,7 +100,7 @@ struct thread_options {
        unsigned int do_disk_util;
        unsigned int override_sync;
        unsigned int rand_repeatable;
-       unsigned int rand_seed;
+       unsigned long long rand_seed;
        unsigned int use_os_rand;
        unsigned int log_avg_msec;
        unsigned int norandommap;
@@ -324,7 +324,7 @@ struct thread_options_pack {
        uint32_t do_disk_util;
        uint32_t override_sync;
        uint32_t rand_repeatable;
-       uint32_t rand_seed;
+       uint64_t rand_seed;
        uint32_t use_os_rand;
        uint32_t log_avg_msec;
        uint32_t norandommap;