about get_rand_file_size()

From: ljzhang,Yaxin Hu,Jianchao Tang <nonggia_at_sjtu.edu.cn>
Date: Fri, 27 Jul 2007 21:18:42 +0800

Jens:
        When I was test my previous fix for 'offset', I encounter another
problem. The files created with a random size by get_rand_file_size()
doesn't in accordance with option 'filesize'.
So I wonder if the function should be fixed like this:
-------------------------------------------
diff -Nraup fio-7.27/filesetup.c fio-7.27-randsize/filesetup.c
--- fio-7.27/filesetup.c 2007-07-27 19:25:06.000000000 +0800
+++ fio-7.27-randsize/filesetup.c 2007-07-27 21:05:51.000000000 +0800
@@ -104,7 +104,7 @@ static unsigned long long get_rand_file_
         long r;
 
         r = os_random_long(&td->file_size_state);
- ret = td->o.file_size_low + (unsigned long long) ((double)
td->o.file_size_high * (r / (RAND_MAX + 1.0)));
+ ret = td->o.file_size_low + (unsigned long long) ((double)
(td->o.file_size_high - td->o.file_size_low) * (r / (RAND_MAX + 1.0)));
         ret -= (ret % td->o.rw_min_bs);
         return ret;
 }
-------------------------------------------

Received on Fri Jul 27 2007 - 15:18:42 CEST

This archive was generated by hypermail 2.2.0 : Fri Jul 27 2007 - 15:30:01 CEST