From: Jens Axboe Date: Wed, 7 Jun 2006 20:42:37 +0000 (+0200) Subject: [PATCH] rwmix seed got broken with random abstraction, fixup X-Git-Tag: fio-1.5~26 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c1ee2ca464edd8b1d4513275aeec15dadb9583af;ds=sidebyside [PATCH] rwmix seed got broken with random abstraction, fixup --- diff --git a/fio.c b/fio.c index 8c48a71c..aa5071ca 100644 --- 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