[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [sheepdog] [PATCH v3 09/10] sheepdog: cancel aio reques
From: |
MORITA Kazutaka |
Subject: |
Re: [Qemu-devel] [sheepdog] [PATCH v3 09/10] sheepdog: cancel aio requests if possible |
Date: |
Thu, 25 Jul 2013 21:54:46 +0900 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) Emacs/22.1 Mule/5.0 (SAKAKI) |
At Thu, 25 Jul 2013 17:04:53 +0800,
Liu Yuan wrote:
>
> >
> > +/*
> > + * Check whether the specified acb can be canceled
> > + *
> > + * We can cancel aio when any request belonging to the acb is:
> > + * - Not processed by the sheepdog server.
> > + * - Not linked to the inflight queue.
> > + */
> > +static bool sd_acb_cancelable(const SheepdogAIOCB *acb)
> > +{
> > + BDRVSheepdogState *s = acb->common.bs->opaque;
> > + AIOReq *aioreq;
> > +
> > + if (!acb->cancelable) {
> > + return false;
> > + }
> > +
> > + QLIST_FOREACH(aioreq, &s->inflight_aio_head, aio_siblings) {
> > + if (aioreq->aiocb == acb) {
> > + return false;
> > + }
> > + }
> > +
> > + return false;
>
> return true; ?
Oops, thanks for the catch!
Thanks,
Kazutaka