X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=1a68ad1171c2a175950f6ac20ac5bcdf1f1803c9;hp=55f3c78c72cbd773cf24a503e30814a9c788e1cf;hb=e7823a941468e807c381fac4c5f7d41329ef0c1d;hpb=0c3d768a44543dd6c23337eafc726e7f88dc3076 diff --git a/io_u.c b/io_u.c index 55f3c78c..1a68ad11 100644 --- a/io_u.c +++ b/io_u.c @@ -165,9 +165,8 @@ static int get_next_offset(struct thread_data *td, struct io_u *io_u) 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]; - } + } 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; @@ -771,6 +770,8 @@ static void io_completed(struct thread_data *td, struct io_u *io_u, if (ret && !icd->error) icd->error = ret; } + if (io_u->unmap) + io_u->unmap(td, io_u); } else { icd->error = io_u->error; io_u_log_error(td, io_u);