From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2L4G-00023E-AB for qemu-devel@nongnu.org; Thu, 25 Jul 2013 08:54:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2L4F-0001Ab-1D for qemu-devel@nongnu.org; Thu, 25 Jul 2013 08:54:52 -0400 Received: from mail-pb0-x235.google.com ([2607:f8b0:400e:c01::235]:61808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2L4E-00019A-Qm for qemu-devel@nongnu.org; Thu, 25 Jul 2013 08:54:50 -0400 Received: by mail-pb0-f53.google.com with SMTP id up15so55807pbc.26 for ; Thu, 25 Jul 2013 05:54:49 -0700 (PDT) Date: Thu, 25 Jul 2013 21:54:46 +0900 Message-ID: From: MORITA Kazutaka In-Reply-To: <20130725090453.GC2604@ubuntu-precise> References: <1374741125-31859-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> <1374741125-31859-10-git-send-email-morita.kazutaka@lab.ntt.co.jp> <20130725090453.GC2604@ubuntu-precise> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [sheepdog] [PATCH v3 09/10] sheepdog: cancel aio requests if possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan Cc: Kevin Wolf , sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , MORITA Kazutaka 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