[sheepdog] [PATCH v3 09/10] sheepdog: cancel aio requests if possible

MORITA Kazutaka morita.kazutaka at gmail.com
Thu Jul 25 14:54:46 CEST 2013


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



More information about the sheepdog mailing list