From 363cffa71a96eb4c7595bb8c325a09eb01f766a5 Mon Sep 17 00:00:00 2001 From: Grant Grundler Date: Tue, 28 Jan 2014 15:11:23 -0700 Subject: [PATCH] fio: consolidate rand_seed to uint64_t 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 Updated by me to change rand_seed option to unsigned long long and changes related to that. Signed-off-by: Jens Axboe --- cconv.c | 4 ++-- ioengine.h | 2 +- options.c | 2 +- thread_options.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cconv.c b/cconv.c index 3f41ae46..0d30f07d 100644 --- 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); diff --git a/ioengine.h b/ioengine.h index 949af915..0756bc7e 100644 --- a/ioengine.h +++ b/ioengine.h @@ -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 diff --git a/options.c b/options.c index 525d3184..82870112 100644 --- 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", diff --git a/thread_options.h b/thread_options.h index 2f807cd7..79c3a892 100644 --- a/thread_options.h +++ b/thread_options.h @@ -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; -- 2.25.1