summaryrefslogtreecommitdiff
path: root/io_u.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-07-10 15:10:17 -0600
committerJens Axboe <axboe@kernel.dk>2018-07-10 15:10:17 -0600
commit09ad10d26facf5ca026589996ba2719b640df35a (patch)
treecbc1e235f3cf6b02df8b098200f8bec62489536e /io_u.c
parent04bc85a130c5dbe25dafe5fa5084c5bdcf63844a (diff)
downloadfio-09ad10d26facf5ca026589996ba2719b640df35a.tar.gz
fio-09ad10d26facf5ca026589996ba2719b640df35a.tar.bz2
io_u: ensure we generate the full length of block sizes
Since we round down, we can miss the last entry. This ensures that if we do: bsrange=4k-16k we actually get an even split of 4,8,12,16k ios. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_u.c')
-rw-r--r--io_u.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/io_u.c b/io_u.c
index 9e9dad5a..5221a78c 100644
--- a/io_u.c
+++ b/io_u.c
@@ -541,10 +541,8 @@ static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u,
r = __rand(&td->bsrange_state[ddir]);
if (!td->o.bssplit_nr[ddir]) {
- buflen = 1 + (unsigned int) ((double) maxbs *
+ buflen = minbs + (unsigned int) ((double) maxbs *
(r / (frand_max + 1.0)));
- if (buflen < minbs)
- buflen = minbs;
} else {
long long perc = 0;
unsigned int i;