X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=688249bd8a727e7910d72388a829f7249b5ee059;hp=8f2ce302080c4ba8c1b54d5e8f41a7e408d5c902;hb=f98f3d076502dfd18a2d1b63443288cab356a983;hpb=237cc3b1e297a9b934a424c6271971b07efc7a66 diff --git a/io_u.c b/io_u.c index 8f2ce302..688249bd 100644 --- a/io_u.c +++ b/io_u.c @@ -234,13 +234,22 @@ ret: return 0; } -static int __get_next_rand_offset_zipf(struct thread_data *td, struct fio_file *f, - enum fio_ddir ddir, unsigned long long *b) +static int __get_next_rand_offset_zipf(struct thread_data *td, + struct fio_file *f, enum fio_ddir ddir, + unsigned long long *b) { *b = zipf_next(&td->zipf); return 0; } +static int __get_next_rand_offset_pareto(struct thread_data *td, + struct fio_file *f, enum fio_ddir ddir, + unsigned long long *b) +{ + *b = pareto_next(&td->zipf); + return 0; +} + static int get_next_rand_offset(struct thread_data *td, struct fio_file *f, enum fio_ddir ddir, unsigned long long *b) { @@ -248,6 +257,8 @@ static int get_next_rand_offset(struct thread_data *td, struct fio_file *f, return __get_next_rand_offset(td, f, ddir, b); else if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) return __get_next_rand_offset_zipf(td, f, ddir, b); + else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) + return __get_next_rand_offset_pareto(td, f, ddir, b); log_err("fio: unknown random distribution: %d\n", td->o.random_distribution); return 1;