X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=2f6aecf2bbf5c7710d99772934e32183a5c4fb89;hp=75b23eb47d9091c58d3df19b2f6def826d3c3836;hb=ece6d647df9a5885ce5325e3e66e4c65d8180e61;hpb=80e88a1d4a84cb243a84a950363c0bce8f73d300 diff --git a/io_u.c b/io_u.c index 75b23eb4..2f6aecf2 100644 --- a/io_u.c +++ b/io_u.c @@ -273,7 +273,7 @@ static int get_next_seq_offset(struct thread_data *td, struct fio_file *f, { assert(ddir_rw(ddir)); - if (f->last_pos >= f->io_size + get_start_offset(td) && td->o.time_based) + if (f->last_pos >= f->io_size + get_start_offset(td, f) && td->o.time_based) f->last_pos = f->last_pos - f->io_size; if (f->last_pos < f->real_file_size) { @@ -415,7 +415,7 @@ static inline int io_u_fits(struct thread_data *td, struct io_u *io_u, { struct fio_file *f = io_u->file; - return io_u->offset + buflen <= f->io_size + get_start_offset(td); + return io_u->offset + buflen <= f->io_size + get_start_offset(td, f); } static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u, @@ -1297,7 +1297,7 @@ int queue_full(struct thread_data *td) struct io_u *__get_io_u(struct thread_data *td) { - struct io_u *io_u; + struct io_u *io_u = NULL; td_io_u_lock(td); @@ -1490,7 +1490,8 @@ struct io_u *get_io_u(struct thread_data *td) if (td->flags & TD_F_REFILL_BUFFERS) { io_u_fill_buffer(td, io_u, io_u->xfer_buflen, io_u->xfer_buflen); - } else if (td->flags & TD_F_SCRAMBLE_BUFFERS) + } else if ((td->flags & TD_F_SCRAMBLE_BUFFERS) && + !(td->flags & TD_F_COMPRESS)) do_scramble = 1; if (td->flags & TD_F_VER_NONE) { populate_verify_io_u(td, io_u); @@ -1595,9 +1596,6 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u, if (!gtod_reduce(td)) add_iops_sample(td, idx, bytes, &icd->time); - - if (td->o.number_ios && !--td->o.number_ios) - td->done = 1; } static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)