X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=io_u.c;h=119dd651a23ef7cbcdf121b2884eca98f3fcb57e;hb=7670fce49ede1ff1361f177c26cd2d41621ee081;hp=8f2ce302080c4ba8c1b54d5e8f41a7e408d5c902;hpb=e25839d4cb5fefcb5ffce76128a4faedb177e7af;p=fio.git diff --git a/io_u.c b/io_u.c index 8f2ce302..119dd651 100644 --- a/io_u.c +++ b/io_u.c @@ -234,10 +234,19 @@ 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(&f->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 = zipf_next(&td->zipf); + *b = pareto_next(&f->zipf); return 0; } @@ -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; @@ -1348,8 +1359,8 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u, if (td->o.max_latency && tusec > td->o.max_latency) { if (!td->error) log_err("fio: latency of %lu usec exceeds specified max (%u usec)\n", tusec, td->o.max_latency); - td_verror(td, ETIME, "max latency exceeded"); - icd->error = ETIME; + td_verror(td, ETIMEDOUT, "max latency exceeded"); + icd->error = ETIMEDOUT; } }