zipf/pareto: use size= if given, not always device size
authorJens Axboe <axboe@kernel.dk>
Fri, 4 Jan 2013 07:26:10 +0000 (08:26 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 4 Jan 2013 07:26:10 +0000 (08:26 +0100)
We used the full device/file size for the zipf or pareto init,
this breaks if size= is specifically given. This causes fio
to generate offsets outside the specified size= range, and fio
will then just exit.

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

index 9d3e06268fffc35786749ea0eb482d0f9bb7ce11..be2eba52e38936a74224267c18eb26b7d1303f7c 100644 (file)
@@ -910,7 +910,7 @@ static int __init_rand_distribution(struct thread_data *td, struct fio_file *f)
 
        range_size = min(td->o.min_bs[DDIR_READ], td->o.min_bs[DDIR_WRITE]);
 
-       nranges = (f->real_file_size + range_size - 1) / range_size;
+       nranges = (f->io_size + range_size - 1) / range_size;
 
        seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number;
        if (!td->o.rand_repeatable)