[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/sg.c b/engines/sg.c
index 3ea1e28..862cd60 100644
--- a/engines/sg.c
+++ b/engines/sg.c
@@ -40,8 +40,8 @@
 	hdr->usr_ptr = io_u;
 
 	if (fs) {
-		hdr->dxferp = io_u->buf;
-		hdr->dxfer_len = io_u->buflen;
+		hdr->dxferp = io_u->xfer_buf;
+		hdr->dxfer_len = io_u->xfer_buflen;
 	}
 }
 
@@ -160,7 +160,7 @@
 	struct sgio_data *sd = td->io_ops->data;
 	int nr_blocks, lba;
 
-	if (io_u->buflen & (sd->bs - 1)) {
+	if (io_u->xfer_buflen & (sd->bs - 1)) {
 		log_err("read/write not sector aligned\n");
 		return EINVAL;
 	}
@@ -183,7 +183,7 @@
 	}
 
 	if (hdr->dxfer_direction != SG_DXFER_NONE) {
-		nr_blocks = io_u->buflen / sd->bs;
+		nr_blocks = io_u->xfer_buflen / sd->bs;
 		lba = io_u->offset / sd->bs;
 		hdr->cmdp[2] = (unsigned char) ((lba >> 24) & 0xff);
 		hdr->cmdp[3] = (unsigned char) ((lba >> 16) & 0xff);