Fio 1.39
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 4d3116b7fd4fc0901f4419e8690270c2c18a2d43..23037f1a8c227114bbcf90b8c0372d8ca5ce108d 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1217,9 +1217,16 @@ void io_u_fill_buffer(struct thread_data *td, struct io_u *io_u,
        long *ptr = io_u->buf;
 
        if (!td->o.zero_buffers) {
+               unsigned long r = __rand(&__fio_rand_state);
+
+               if (sizeof(int) != sizeof(*ptr))
+                       r *= (unsigned long) __rand(&__fio_rand_state);
+
                while ((void *) ptr - io_u->buf < max_bs) {
-                       *ptr = __rand(&__fio_rand_state);
+                       *ptr = r;
                        ptr++;
+                       r *= GOLDEN_RATIO_PRIME;
+                       r >>= 3;
                }
        } else
                memset(ptr, 0, max_bs);