summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'posix-aio-compat.c')
-rw-r--r--posix-aio-compat.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 9320b3d79..ca528766a 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
-#include "sys-queue.h"
+#include "qemu-queue.h"
#include "osdep.h"
#include "qemu-common.h"
#include "block_int.h"
@@ -44,7 +44,7 @@ struct qemu_paiocb {
int ev_signo;
off_t aio_offset;
- TAILQ_ENTRY(qemu_paiocb) node;
+ QTAILQ_ENTRY(qemu_paiocb) node;
int aio_type;
ssize_t ret;
int active;
@@ -64,7 +64,7 @@ static pthread_attr_t attr;
static int max_threads = 64;
static int cur_threads = 0;
static int idle_threads = 0;
-static TAILQ_HEAD(, qemu_paiocb) request_list;
+static QTAILQ_HEAD(, qemu_paiocb) request_list;
#ifdef CONFIG_PREADV
static int preadv_present = 1;
@@ -139,7 +139,7 @@ static size_t handle_aiocb_flush(struct qemu_paiocb *aiocb)
{
int ret;
- ret = fdatasync(aiocb->aio_fildes);
+ ret = qemu_fdatasync(aiocb->aio_fildes);
if (ret == -1)
return -errno;
return 0;
@@ -322,16 +322,16 @@ static void *aio_thread(void *unused)
mutex_lock(&lock);
- while (TAILQ_EMPTY(&request_list) &&
+ while (QTAILQ_EMPTY(&request_list) &&
!(ret == ETIMEDOUT)) {
ret = cond_timedwait(&cond, &lock, &ts);
}
- if (TAILQ_EMPTY(&request_list))
+ if (QTAILQ_EMPTY(&request_list))
break;
- aiocb = TAILQ_FIRST(&request_list);
- TAILQ_REMOVE(&request_list, aiocb, node);
+ aiocb = QTAILQ_FIRST(&request_list);
+ QTAILQ_REMOVE(&request_list, aiocb, node);
aiocb->active = 1;
idle_threads--;
mutex_unlock(&lock);
@@ -382,7 +382,7 @@ static void qemu_paio_submit(struct qemu_paiocb *aiocb)
mutex_lock(&lock);
if (idle_threads == 0 && cur_threads < max_threads)
spawn_thread();
- TAILQ_INSERT_TAIL(&request_list, aiocb, node);
+ QTAILQ_INSERT_TAIL(&request_list, aiocb, node);
mutex_unlock(&lock);
cond_signal(&cond);
}
@@ -510,7 +510,7 @@ static void paio_cancel(BlockDriverAIOCB *blockacb)
mutex_lock(&lock);
if (!acb->active) {
- TAILQ_REMOVE(&request_list, acb, node);
+ QTAILQ_REMOVE(&request_list, acb, node);
acb->ret = -ECANCELED;
} else if (acb->ret == -EINPROGRESS) {
active = 1;
@@ -616,7 +616,7 @@ void *paio_init(void)
if (ret)
die2(ret, "pthread_attr_setdetachstate");
- TAILQ_INIT(&request_list);
+ QTAILQ_INIT(&request_list);
posix_aio_state = s;