Merge branch 'master' of ssh://git.kernel.dk/data/git/fio
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index f61fee8cb32240d2d85929eb0d131b009ec0d47d..16065128c324e76e3cf9326ff1824fec42baad5b 100644 (file)
--- 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;
@@ -590,9 +601,6 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
        if (td_rw(td) && __should_check_rate(td, odir))
                td->rate_pending_usleep[odir] -= usec;
 
-       if (ddir == DDIR_TRIM)
-               return DDIR_TRIM;
-
        return ddir;
 }
 
@@ -1898,8 +1906,10 @@ void fill_io_buffer(struct thread_data *td, void *buf, unsigned int min_write,
                } while (left);
        } else if (o->buffer_pattern_bytes)
                fill_buffer_pattern(td, buf, max_bs);
-       else
+       else if (o->zero_buffers)
                memset(buf, 0, max_bs);
+       else
+               fill_random_buf(get_buf_state(td), buf, max_bs);
 }
 
 /*