projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d16b88e
)
file_service_type=random fix
author
Jens Axboe
<jens.axboe@oracle.com>
Thu, 8 Mar 2007 12:33:36 +0000
(13:33 +0100)
committer
Jens Axboe
<jens.axboe@oracle.com>
Thu, 8 Mar 2007 12:33:36 +0000
(13:33 +0100)
It generated 0..n-1, where we wanted 0..n.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
io_u.c
patch
|
blob
|
blame
|
history
diff --git
a/io_u.c
b/io_u.c
index 0c604dff8640cde9ae25b000b5f33124c0d9c51e..9f3bb22d1d96be1c5c1d69492774012fc54caa65 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-335,7
+335,7
@@
static struct fio_file *get_next_file_rand(struct thread_data *td)
do {
long r = os_random_long(&td->next_file_state);
- fileno = (unsigned int) ((double) (td->open_files
- 1) * r
/ (RAND_MAX + 1.0));
+ fileno = (unsigned int) ((double) (td->open_files
* r)
/ (RAND_MAX + 1.0));
f = &td->files[fileno];
if (f->fd != -1)
return f;