[PATCH] rwmix seed got broken with random abstraction, fixup
authorJens Axboe <axboe@suse.de>
Wed, 7 Jun 2006 20:42:37 +0000 (22:42 +0200)
committerJens Axboe <axboe@suse.de>
Wed, 7 Jun 2006 20:42:37 +0000 (22:42 +0200)
fio.c

diff --git a/fio.c b/fio.c
index 8c48a71c0481b69c8a1235d6a53f481c8bb3279c..aa5071ca527e7d77817b6ffefb2270171f9254e8 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -360,11 +360,11 @@ static int get_rw_ddir(struct thread_data *td)
                 * Check if it's time to seed a new data direction.
                 */
                if (elapsed >= td->rwmixcycle) {
-                       unsigned long v;
+                       int v;
                        long r;
 
-                       r = os_random_long(&td->random_state);
-                       v = 100UL * r / (unsigned long) (RAND_MAX + 1.0);
+                       r = os_random_long(&td->rwmix_state);
+                       v = 1 + (int) (100.0 * (r / (RAND_MAX + 1.0)));
                        if (v < td->rwmixread)
                                td->rwmix_ddir = DDIR_READ;
                        else