[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/13] Remove active field in qemu_aiocb structure.
From: |
Arun R Bharadwaj |
Subject: |
[Qemu-devel] [PATCH 07/13] Remove active field in qemu_aiocb structure. |
Date: |
Tue, 04 Jan 2011 10:57:44 +0530 |
User-agent: |
StGit/0.15 |
The active field in the qemu_aiocb structure is now useless.
Remove it.
Signed-off-by: Arun R Bharadwaj <address@hidden>
---
posix-aio-compat.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 8f1a9b6..fd9fcfd 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -69,7 +69,6 @@ struct qemu_paiocb {
int aio_type;
ssize_t ret;
- int active;
struct qemu_paiocb *next;
int async_context_id;
@@ -345,7 +344,6 @@ static void aio_thread(ThreadletWork *work)
pid = getpid();
aiocb = container_of(work, struct qemu_paiocb, work);
- aiocb->active = 1;
switch (aiocb->aio_type & QEMU_AIO_TYPE_MASK) {
case QEMU_AIO_READ:
@@ -452,7 +450,6 @@ static void qemu_paio_submit(struct qemu_paiocb *aiocb)
{
qemu_mutex_lock(&aiocb_mutex);
aiocb->ret = -EINPROGRESS;
- aiocb->active = 0;
qemu_mutex_unlock(&aiocb_mutex);
aiocb->work.func = aio_thread;
@@ -596,15 +593,13 @@ static int dequeue_work(ThreadletWork *work)
static void paio_cancel(BlockDriverAIOCB *blockacb)
{
struct qemu_paiocb *acb = (struct qemu_paiocb *)blockacb;
- if (!acb->active) {
- if (dequeue_work(&acb->work) != 0) {
- /* Wait for running work item to complete */
- qemu_mutex_lock(&aiocb_mutex);
- while (acb->ret == -EINPROGRESS) {
- qemu_cond_wait(&aiocb_completion, &aiocb_mutex);
- }
- qemu_mutex_unlock(&aiocb_mutex);
+ if (dequeue_work(&acb->work) != 0) {
+ /* Wait for running work item to complete */
+ qemu_mutex_lock(&aiocb_mutex);
+ while (acb->ret == -EINPROGRESS) {
+ qemu_cond_wait(&aiocb_completion, &aiocb_mutex);
}
+ qemu_mutex_unlock(&aiocb_mutex);
}
paio_remove(acb);
- [Qemu-devel] Re: [PATCH 03/13] Add callback function to ThreadletWork structure., (continued)
- [Qemu-devel] [PATCH 07/13] Remove active field in qemu_aiocb structure.,
Arun R Bharadwaj <=
- [Qemu-devel] [PATCH 08/13] Remove thread_create routine., Arun R Bharadwaj, 2011/01/04
- [Qemu-devel] [PATCH 09/13] Threadlet: Add aio_signal_handler threadlet API, Arun R Bharadwaj, 2011/01/04
- [Qemu-devel] [PATCH 10/13] Remove all instances of CONFIG_THREAD, Arun R Bharadwaj, 2011/01/04
- [Qemu-devel] [PATCH 11/13] Move threadlet code to qemu-threadlets.c, Arun R Bharadwaj, 2011/01/04
- [Qemu-devel] [PATCH 12/13] Threadlets: Add functionality to create private queues., Arun R Bharadwaj, 2011/01/04
- [Qemu-devel] [PATCH 13/13] Threadlets: Add documentation, Arun R Bharadwaj, 2011/01/04
- Re: [Qemu-devel] [PATCH 00/13] Threadlets infrastructure., Venkateswararao Jujjuri (JV), 2011/01/04