summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-09-14 08:48:43 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2009-09-14 08:48:43 -0300
commit184b194ef1a8b8ce035d48c3fbdd72e3b4732869 (patch)
treea4e50b03279f2a140a99aca8689973090afa151d /posix-aio-compat.c
parentMerge commit '2637c754ccdb286890ed2a8d0d1da775dbd062af' into upstream-merge (diff)
parentFix sys-queue.h conflict for good (diff)
downloadqemu-kvm-184b194ef1a8b8ce035d48c3fbdd72e3b4732869.tar.gz
qemu-kvm-184b194ef1a8b8ce035d48c3fbdd72e3b4732869.tar.bz2
qemu-kvm-184b194ef1a8b8ce035d48c3fbdd72e3b4732869.zip
Merge commit '72cf2d4f0e181d0d3a3122e04129c58a95da713e' into upstream-merge
* commit '72cf2d4f0e181d0d3a3122e04129c58a95da713e': Fix sys-queue.h conflict for good Try to fix BSD breakage by 806b60248218bd5f74a8b070f5a99a864e8e51c6 Include sys-queue.h early to override system queue definitions on BSD Unbreak BSD: use qemu_fdatasync instead of fdatasync Use proper format conversion specifier when printing size_t value audio: remove lsbindex/popcount in favour of host-utils's ctz32 alsa: poll mode handling oss: poll mode handling audio: poll mode infrastructure gus: Do not manually free the state, qdev does it for us oss: Unbreak mmaping the ability to mmap oss fd on Linux Conflicts: exec.c kvm.h sysemu.h vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
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;