Switch the latter part of the offset generation to __rand() too
authorJens Axboe <jaxboe@fusionio.com>
Mon, 28 Mar 2011 07:37:41 +0000 (09:37 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Mon, 28 Mar 2011 07:37:41 +0000 (09:37 +0200)
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index e9ce37e..c672993 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -210,7 +210,10 @@ static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
                if (!get_next_free_block(td, f, ddir, b))
                        goto ret;
 
-               r = os_random_long(&td->random_state);
+               if (td->o.use_os_rand)
+                       r = os_random_long(&td->random_state);
+               else
+                       r = __rand(&td->__random_state);
        } while (--loops);
 
        /*