X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=16065128c324e76e3cf9326ff1824fec42baad5b;hp=a45dd4021c4e161f945367a3aec59dde0ebd4c57;hb=56d9fa4b8d4fa5166e3ec5dcdd37b5789b2cb01d;hpb=7d1bb70f3d85d041b4b7dd926e98054fea980bdc diff --git a/io_u.c b/io_u.c index a45dd402..16065128 100644 --- a/io_u.c +++ b/io_u.c @@ -149,6 +149,15 @@ static int __get_next_rand_offset_pareto(struct thread_data *td, return 0; } +static int __get_next_rand_offset_gauss(struct thread_data *td, + struct fio_file *f, enum fio_ddir ddir, + uint64_t *b) +{ + *b = gauss_next(&f->gauss); + return 0; +} + + static int flist_cmp(void *data, struct flist_head *a, struct flist_head *b) { struct rand_off *r1 = flist_entry(a, struct rand_off, list); @@ -166,6 +175,8 @@ static int get_off_from_method(struct thread_data *td, struct fio_file *f, 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); + else if (td->o.random_distribution == FIO_RAND_DIST_GAUSS) + return __get_next_rand_offset_gauss(td, f, ddir, b); log_err("fio: unknown random distribution: %d\n", td->o.random_distribution); return 1; @@ -1484,8 +1495,7 @@ struct io_u *get_io_u(struct thread_data *td) io_u_fill_buffer(td, io_u, td->o.min_bs[DDIR_WRITE], io_u->xfer_buflen); - } - if ((td->flags & TD_F_SCRAMBLE_BUFFERS) && + } else if ((td->flags & TD_F_SCRAMBLE_BUFFERS) && !(td->flags & TD_F_COMPRESS)) do_scramble = 1; if (td->flags & TD_F_VER_NONE) {