diff options
Diffstat (limited to 'posix-aio-compat.c')
-rw-r--r-- | posix-aio-compat.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/posix-aio-compat.c b/posix-aio-compat.c index 8bb3d10..68cbec8 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" @@ -43,7 +43,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; @@ -63,7 +63,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; @@ -321,16 +321,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); @@ -381,7 +381,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); } @@ -509,7 +509,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; @@ -619,7 +619,7 @@ void *paio_init(void) if (ret) die2(ret, "pthread_attr_setdetachstate"); - TAILQ_INIT(&request_list); + QTAILQ_INIT(&request_list); posix_aio_state = s; |