[PATCH] Support residual io counts from io engines

We need this for requeuing support, the network engine makes this
pretty apparent (it's not unusual to see short tranfers there).

Basically we add an xfer_buf and xfer_buflen member to the io_u,
and these are the fields that the io engine MUST use. That allows
fio to increment and reset these appropriately, and simply requeue
the io_u for service of the next part of it.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/engines/libaio.c b/engines/libaio.c
index da43f18..9a644f6 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -25,9 +25,9 @@
 	struct fio_file *f = io_u->file;
 
 	if (io_u->ddir == DDIR_READ)
-		io_prep_pread(&io_u->iocb, f->fd, io_u->buf, io_u->buflen, io_u->offset);
+		io_prep_pread(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
 	else if (io_u->ddir == DDIR_WRITE)
-		io_prep_pwrite(&io_u->iocb, f->fd, io_u->buf, io_u->buflen, io_u->offset);
+		io_prep_pwrite(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
 	else if (io_u->ddir == DDIR_SYNC)
 		io_prep_fsync(&io_u->iocb, f->fd);
 	else
@@ -87,7 +87,7 @@
 	} while (1);
 
 	if (ret <= 0) {
-		io_u->resid = io_u->buflen;
+		io_u->resid = io_u->xfer_buflen;
 		io_u->error = -ret;
 		return 1;
 	}