On 11/10/2016 11:19 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf <[email protected]> > --- > block/quorum.c | 194 > ++++++++++++++++++++++++++++++++++----------------------- > 1 file changed, 117 insertions(+), 77 deletions(-) >
> +
> +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 */
Why bother to invalidate co...
> +
> + 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);
> +}
...when it isn't used later? Is it just for future-proofing edits made
in later patches?
> +static void write_quorum_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 */
> +
> + acb->qcrs[i].bs = s->children[i]->bs;
> + ret = bdrv_co_pwritev(s->children[i], acb->sector_num * BDRV_SECTOR_SIZE,
> + acb->nb_sectors * BDRV_SECTOR_SIZE, acb->qiov, 0);
> + quorum_aio_cb(&acb->qcrs[i], ret);
> }
and again
Otherwise, the conversion looks sane to me, but I'm just weak enough on
coroutines that I won't give R-b while this is still in RFC
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
