summaryrefslogtreecommitdiff
path: root/io_u.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-06-12 08:42:49 -0600
committerJens Axboe <axboe@kernel.dk>2018-06-12 08:48:55 -0600
commit1bd5d21380cdafe36db5a8945fb7c755d8ce3d43 (patch)
tree2084c6e799a15e345f2cef60f7c7143b8f35dbf5 /io_u.c
parent56c77c10f79d7be492aa0fb137786978c3596682 (diff)
downloadfio-1bd5d21380cdafe36db5a8945fb7c755d8ce3d43.tar.gz
fio-1bd5d21380cdafe36db5a8945fb7c755d8ce3d43.tar.bz2
rand: cleanup rand_between() and helpers
Make the 32/64-bit helper just return a random number up to a certain value, and let the generic helper handle the range part. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_u.c')
-rw-r--r--io_u.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/io_u.c b/io_u.c
index 945aa192..580c4146 100644
--- a/io_u.c
+++ b/io_u.c
@@ -168,7 +168,7 @@ bail:
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
- v = rand32_between(&td->zone_state, 1, 100);
+ v = rand_between(&td->zone_state, 1, 100);
/*
* Find our generated table. 'send' is the end block of this zone,
@@ -225,7 +225,7 @@ bail:
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
- v = rand32_between(&td->zone_state, 1, 100);
+ v = rand_between(&td->zone_state, 1, 100);
zsi = &td->zone_state_index[ddir][v - 1];
stotal = zsi->size_perc_prev;
@@ -300,7 +300,7 @@ static bool should_do_random(struct thread_data *td, enum fio_ddir ddir)
if (td->o.perc_rand[ddir] == 100)
return true;
- v = rand32_between(&td->seq_rand_state[ddir], 1, 100);
+ v = rand_between(&td->seq_rand_state[ddir], 1, 100);
return v <= td->o.perc_rand[ddir];
}
@@ -589,7 +589,7 @@ static inline enum fio_ddir get_rand_ddir(struct thread_data *td)
{
unsigned int v;
- v = rand32_between(&td->rwmix_state, 1, 100);
+ v = rand_between(&td->rwmix_state, 1, 100);
if (v <= td->o.rwmix[DDIR_READ])
return DDIR_READ;
@@ -2069,7 +2069,7 @@ static struct frand_state *get_buf_state(struct thread_data *td)
return &td->buf_state;
}
- v = rand32_between(&td->dedupe_state, 1, 100);
+ v = rand_between(&td->dedupe_state, 1, 100);
if (v <= td->o.dedupe_percentage)
return &td->buf_state_prev;