From a5d412078b8e7478d81df03710eacc7a21096ba2 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Mon, 10 May 2010 18:37:10 -0700 Subject: Upstream: Replace sys-queue.h with qemu-queue.h Change-Id: I5c51f54a7fe2ea702420429bbf0c789ed6d8c534 --- aio-android.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'aio-android.c') diff --git a/aio-android.c b/aio-android.c index a5be934..53f7a6d 100644 --- a/aio-android.c +++ b/aio-android.c @@ -13,14 +13,14 @@ #include "qemu-common.h" #include "block.h" -#include "sys-queue.h" +#include "qemu-queue.h" #include "qemu_socket.h" #include "iolooper.h" typedef struct AioHandler AioHandler; /* The list of registered AIO handlers */ -static LIST_HEAD(, AioHandler) aio_handlers; +static QLIST_HEAD(, AioHandler) aio_handlers; /* This is a simple lock used to protect the aio_handlers list. Specifically, * it's used to ensure that no callbacks are removed while we're walking and @@ -36,14 +36,14 @@ struct AioHandler AioFlushHandler *io_flush; int deleted; void *opaque; - LIST_ENTRY(AioHandler) node; + QLIST_ENTRY(AioHandler) node; }; static AioHandler *find_aio_handler(int fd) { AioHandler *node; - LIST_FOREACH(node, &aio_handlers, node) { + QLIST_FOREACH(node, &aio_handlers, node) { if (node->fd == fd) if (!node->deleted) return node; @@ -73,7 +73,7 @@ int qemu_aio_set_fd_handler(int fd, * deleted because deleted nodes are only cleaned up after * releasing the walking_handlers lock. */ - LIST_REMOVE(node, node); + QLIST_REMOVE(node, node); qemu_free(node); } } @@ -82,7 +82,7 @@ int qemu_aio_set_fd_handler(int fd, /* Alloc and insert if it's not already there */ node = qemu_mallocz(sizeof(AioHandler)); node->fd = fd; - LIST_INSERT_HEAD(&aio_handlers, node, node); + QLIST_INSERT_HEAD(&aio_handlers, node, node); } /* Update handler with latest information */ node->io_read = io_read; @@ -110,7 +110,7 @@ void qemu_aio_flush(void) */ qemu_aio_wait(); - LIST_FOREACH(node, &aio_handlers, node) { + QLIST_FOREACH(node, &aio_handlers, node) { ret |= node->io_flush(node->opaque); } } while (ret > 0); @@ -133,7 +133,7 @@ void qemu_aio_wait(void) walking_handlers = 1; /* fill fd sets */ - LIST_FOREACH(node, &aio_handlers, node) { + QLIST_FOREACH(node, &aio_handlers, node) { /* If there aren't pending AIO operations, don't invoke callbacks. * Otherwise, if there are no AIO requests, qemu_aio_wait() would * wait indefinitely. @@ -160,7 +160,7 @@ void qemu_aio_wait(void) /* we have to walk very carefully in case * qemu_aio_set_fd_handler is called while we're walking */ - node = LIST_FIRST(&aio_handlers); + node = QLIST_FIRST(&aio_handlers); while (node) { AioHandler *tmp; @@ -176,10 +176,10 @@ void qemu_aio_wait(void) } tmp = node; - node = LIST_NEXT(node, node); + node = QLIST_NEXT(node, node); if (tmp->deleted) { - LIST_REMOVE(tmp, node); + QLIST_REMOVE(tmp, node); qemu_free(tmp); } } -- cgit v1.1