[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-block] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev |
Date: |
Wed, 16 Nov 2016 16:57:44 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Thu 10 Nov 2016 06:19:04 PM CET, Kevin Wolf wrote:
> +typedef struct QuorumCo {
> + QuorumAIOCB *acb;
> int i;
Maybe 'i' could rename to something a bit more descriptive ('idx', I
don't know).
> +} QuorumCo;
> +
> +static void read_quorum_children_entry(void *opaque)
> +{
> + QuorumCo *co = opaque;
> + QuorumAIOCB *acb = co->acb;
> + BDRVQuorumState *s = acb->bs->opaque;
> + int i = co->i;
> + int ret;
> + co = NULL; /* Not valid after the first yield */
I also don't understand this last line. Is it to make sure that no one
tries to use it after the bdrv_co_preadv() call?
> + acb->qcrs[i].bs = s->children[i]->bs;
> + ret = bdrv_co_preadv(s->children[i], acb->sector_num * BDRV_SECTOR_SIZE,
> + acb->nb_sectors * BDRV_SECTOR_SIZE,
> + &acb->qcrs[i].qiov, 0);
> + quorum_aio_cb(&acb->qcrs[i], ret);
> +}
Otherwise the patch looks good to me.
Berto
- [Qemu-block] [RFC PATCH 0/8] quorum: Implement .bdrv_co_preadv/pwritev(), Kevin Wolf, 2016/11/10
- [Qemu-block] [RFC PATCH 2/8] quorum: Remove s from quorum_aio_get() arguments, Kevin Wolf, 2016/11/10
- [Qemu-block] [RFC PATCH 1/8] coroutine: Introduce qemu_coroutine_enter_if_inactive(), Kevin Wolf, 2016/11/10
- [Qemu-block] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev, Kevin Wolf, 2016/11/10
- [Qemu-block] [RFC PATCH 4/8] quorum: Do cleanup in caller coroutine, Kevin Wolf, 2016/11/10
- [Qemu-block] [RFC PATCH 5/8] quorum: Inline quorum_aio_cb(), Kevin Wolf, 2016/11/10
- [Qemu-block] [RFC PATCH 6/8] quorum: Avoid bdrv_aio_writev() for rewrites, Kevin Wolf, 2016/11/10