init: kill get_rand_start_delay()
authorJens Axboe <axboe@kernel.dk>
Tue, 12 Jun 2018 14:47:08 +0000 (08:47 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 12 Jun 2018 14:48:55 +0000 (08:48 -0600)
It's now useless, just call rand_between().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c

diff --git a/init.c b/init.c
index e25e5e4..02793dd 100644 (file)
--- a/init.c
+++ b/init.c
@@ -574,22 +574,6 @@ static int fixed_block_size(struct thread_options *o)
                o->min_bs[DDIR_READ] == o->min_bs[DDIR_TRIM];
 }
 
-
-static unsigned long long get_rand_start_delay(struct thread_data *td)
-{
-       unsigned long long delayrange;
-       uint64_t r, frand_max;
-
-       delayrange = td->o.start_delay_high - td->o.start_delay;
-
-       frand_max = rand_max(&td->delay_state);
-       r = __rand(&td->delay_state);
-       delayrange = (unsigned long long) ((double) delayrange * (r / (frand_max + 1.0)));
-
-       delayrange += td->o.start_delay_orig;
-       return delayrange;
-}
-
 /*
  * <3 Johannes
  */
@@ -687,7 +671,9 @@ static int fixup_options(struct thread_data *td)
        if (o->start_delay_high) {
                if (!o->start_delay_orig)
                        o->start_delay_orig = o->start_delay;
-               o->start_delay = get_rand_start_delay(td);
+               o->start_delay = rand_between(&td->delay_state,
+                                               td->o.start_delay_orig,
+                                               td->o.start_delay_high);
        }
 
        if (o->norandommap && o->verify != VERIFY_NONE