aboutsummaryrefslogtreecommitdiffstats
path: root/posix-aio-compat.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-09 16:07:11 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-06-01 17:08:17 +0200
commit1646b4eb23bb788e9398583c442db9b70a85921a (patch)
treeecec1a15ba852621a7c34359ab63dea0a82c7e13 /posix-aio-compat.c
parent088edf82b3d34409ed9d9fd09ec1f7e9b933304f (diff)
downloadexternal_qemu-1646b4eb23bb788e9398583c442db9b70a85921a.zip
external_qemu-1646b4eb23bb788e9398583c442db9b70a85921a.tar.gz
external_qemu-1646b4eb23bb788e9398583c442db9b70a85921a.tar.bz2
posix-aio-compat.c: minor integrate
Change-Id: Iccf0a0794e55546dd538e362a4b5837ee8b2c1d7
Diffstat (limited to 'posix-aio-compat.c')
-rw-r--r--posix-aio-compat.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index a67ffe3..e1c58d0 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -24,6 +24,7 @@
#include "qemu-queue.h"
#include "osdep.h"
+#include "sysemu.h"
#include "qemu-common.h"
#include "block_int.h"
@@ -127,7 +128,7 @@ static ssize_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb)
/*
* This looks weird, but the aio code only consideres a request
- * successfull if it has written the number full number of bytes.
+ * successful if it has written the number full number of bytes.
*
* Now we overload aio_nbytes as aio_ioctl_cmd for the ioctl command,
* so in fact we return the ioctl command here to make posix_aio_read()
@@ -269,7 +270,7 @@ static ssize_t handle_aiocb_rw(struct qemu_paiocb *aiocb)
* Ok, we have to do it the hard way, copy all segments into
* a single aligned buffer.
*/
- buf = qemu_memalign(512, aiocb->aio_nbytes);
+ buf = qemu_blockalign(aiocb->common.bs, aiocb->aio_nbytes);
if (aiocb->aio_type & QEMU_AIO_WRITE) {
char *p = buf;
int i;
@@ -453,6 +454,9 @@ static int posix_aio_process_queue(void *opaque)
} else {
ret = -ret;
}
+
+ //trace_paio_complete(acb, acb->common.opaque, ret);
+
/* remove the request */
*pacb = acb->next;
/* call the callback */
@@ -535,6 +539,8 @@ static void paio_cancel(BlockDriverAIOCB *blockacb)
struct qemu_paiocb *acb = (struct qemu_paiocb *)blockacb;
int active = 0;
+ //trace_paio_cancel(acb, acb->common.opaque);
+
mutex_lock(&lock);
if (!acb->active) {
QTAILQ_REMOVE(&request_list, acb, node);
@@ -583,6 +589,7 @@ BlockDriverAIOCB *paio_submit(BlockDriverState *bs, int fd,
acb->next = posix_aio_state->first_aio;
posix_aio_state->first_aio = acb;
+ //trace_paio_submit(acb, opaque, sector_num, nb_sectors, type);
qemu_paio_submit(acb);
return &acb->common;
}
@@ -599,6 +606,7 @@ BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd,
acb->aio_type = QEMU_AIO_IOCTL;
acb->aio_fildes = fd;
acb->ev_signo = SIGUSR2;
+ acb->async_context_id = get_async_context_id();
acb->aio_offset = 0;
acb->aio_ioctl_buf = buf;
acb->aio_ioctl_cmd = req;