projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] non-stop thread
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index 18e3c3f1c5b9d08d40e4b3b40876b8a36e6a8e4d..55f3c78c72cbd773cf24a503e30814a9c788e1cf 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-162,10
+162,12
@@
static int get_next_offset(struct thread_data *td, struct io_u *io_u)
if (get_next_rand_offset(td, f, ddir, &b))
return 1;
} else {
if (get_next_rand_offset(td, f, ddir, &b))
return 1;
} else {
- if (f->last_pos >= f->real_file_size)
- return 1;
-
- b = f->last_pos / td->o.min_bs[ddir];
+ if (f->last_pos >= f->real_file_size) {
+ if (!td_random(td) || get_next_rand_offset(td, f, ddir, &b))
+ return 1;
+ } else {
+ b = f->last_pos / td->o.min_bs[ddir];
+ }
}
io_u->offset = (b * td->o.min_bs[ddir]) + f->file_offset;
}
io_u->offset = (b * td->o.min_bs[ddir]) + f->file_offset;