aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-12-11 14:52:28 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-12-12 16:57:55 +0000
commit8455ce053aa07eecdbc8da8db612cb58efc0734c (patch)
treed0182d57a9ab901bd90ea2011f8871f9b8aa51d2 /block
parent43f2376e096382df44d9322ae0cbdca89612d464 (diff)
linux-aio: rename LaioQueue idx field to "n"
It does not identify an index in an array anymore. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-id: 1418305950-30924-4-git-send-email-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/linux-aio.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c
index b8709427a4..b223d9e3d9 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -40,7 +40,7 @@ struct qemu_laiocb {
typedef struct {
int plugged;
- unsigned int idx;
+ unsigned int n;
bool blocked;
QSIMPLEQ_HEAD(, qemu_laiocb) pending;
} LaioQueue;
@@ -180,7 +180,7 @@ static void ioq_init(LaioQueue *io_q)
{
QSIMPLEQ_INIT(&io_q->pending);
io_q->plugged = 0;
- io_q->idx = 0;
+ io_q->n = 0;
io_q->blocked = false;
}
@@ -208,11 +208,11 @@ static int ioq_submit(struct qemu_laio_state *s)
}
for (i = 0; i < ret; i++) {
- s->io_q.idx--;
+ s->io_q.n--;
QSIMPLEQ_REMOVE_HEAD(&s->io_q.pending, next);
}
} while (ret == len && !QSIMPLEQ_EMPTY(&s->io_q.pending));
- s->io_q.blocked = (s->io_q.idx > 0);
+ s->io_q.blocked = (s->io_q.n > 0);
return ret;
}
@@ -276,9 +276,9 @@ BlockAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
io_set_eventfd(&laiocb->iocb, event_notifier_get_fd(&s->e));
QSIMPLEQ_INSERT_TAIL(&s->io_q.pending, laiocb, next);
- s->io_q.idx++;
+ s->io_q.n++;
if (!s->io_q.blocked &&
- (!s->io_q.plugged || s->io_q.idx >= MAX_QUEUED_IO)) {
+ (!s->io_q.plugged || s->io_q.n >= MAX_QUEUED_IO)) {
ioq_submit(s);
}
return &laiocb->common;