Fix problem with f->last_completed_pos not being correct on requeues
This causes an unnecessary seek. Usually this is just noise, but if
the device isn't seekable, it becomes a real problem.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/io_u.c b/io_u.c
index 1ae6378..0487857 100644
--- a/io_u.c
+++ b/io_u.c
@@ -588,6 +588,7 @@
/*
* Set io data pointers.
*/
+ io_u->endpos = io_u->offset + io_u->buflen;
out:
io_u->xfer_buf = io_u->buf;
io_u->xfer_buflen = io_u->buflen;
@@ -645,7 +646,7 @@
td->zone_bytes += bytes;
td->this_io_bytes[idx] += bytes;
- io_u->file->last_completed_pos = io_u->offset + io_u->buflen;
+ io_u->file->last_completed_pos = io_u->endpos;
msec = mtime_since(&io_u->issue_time, &icd->time);