X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=93c451cb9bd9c69038ae20e45d5fc4f4d30af1fc;hp=18e3c3f1c5b9d08d40e4b3b40876b8a36e6a8e4d;hb=8670579ed3a063723f194e6fec8250bec4d8ea25;hpb=b6a4c7d152075209ba84ca05c32154427cbcd275 diff --git a/io_u.c b/io_u.c index 18e3c3f1..93c451cb 100644 --- a/io_u.c +++ b/io_u.c @@ -162,10 +162,11 @@ 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 (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 - f->file_offset) / td->o.min_bs[ddir]; } io_u->offset = (b * td->o.min_bs[ddir]) + f->file_offset; @@ -312,6 +313,9 @@ void requeue_io_u(struct thread_data *td, struct io_u **io_u) static int fill_io_u(struct thread_data *td, struct io_u *io_u) { + if (td->io_ops->flags & FIO_NOIO) + goto out; + /* * see if it's time to sync */ @@ -759,6 +763,7 @@ static void io_completed(struct thread_data *td, struct io_u *io_u, io_u_mark_latency(td, usec); if (td_write(td) && idx == DDIR_WRITE && + td->o.do_verify && td->o.verify != VERIFY_NONE) log_io_piece(td, io_u);