From patchwork Fri Oct 8 15:50:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yehuda Sadeh Weinraub X-Patchwork-Id: 241561 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o98Fo6bW031506 for ; Fri, 8 Oct 2010 15:50:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757712Ab0JHPuE (ORCPT ); Fri, 8 Oct 2010 11:50:04 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:42686 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753784Ab0JHPuD convert rfc822-to-8bit (ORCPT ); Fri, 8 Oct 2010 11:50:03 -0400 Received: by wyb28 with SMTP id 28so1225257wyb.19 for ; Fri, 08 Oct 2010 08:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=mmjAgcjSA6gglv1Qz28dNBXl3hEpSpFJ+GwHbajpR0g=; b=jeN1d4A7AsKN8U/9T7DdC4ASbOE3KcU0soNofrUJ/FAxvBJlfITNsJidVtwBCEsmH6 JoOCZVNB3YquBKg3vOlYR/eNkBe985U20QoDxoYzJEXbg9INRrKTmwNsKqhLwnSNZHRg zNSj7wY4t/OCCJ5lOr5iufNaPvL8l5vC1PGNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=om18lBHKy/+l+J0G4xLL41JjGF2IYorFEERdaEOZ3wBpgWeQZBdFvH9r52DNO1ZPvH XayNQ9YjOI9D1KyzAdV3DS5p3IsoEem+mCQTQ+1sojiMiRT1rnX8KWa/IymQ2slISJpO CLq9bx3emKzBdkFepoIDnnjdD98epw++apQLE= MIME-Version: 1.0 Received: by 10.216.233.163 with SMTP id p35mr783578weq.98.1286553001671; Fri, 08 Oct 2010 08:50:01 -0700 (PDT) Received: by 10.216.160.77 with HTTP; Fri, 8 Oct 2010 08:50:01 -0700 (PDT) In-Reply-To: <4CAF255A.1030103@codemonkey.ws> References: <20100802194631.GA4923@chb-desktop> <20100803201407.GD1475@chb-desktop> <4CADD567.9010606@codemonkey.ws> <4CAE13BA.70707@codemonkey.ws> <4CAE24C5.8030007@codemonkey.ws> <4CAE35C5.2010809@codemonkey.ws> <4CAE41BD.2070508@codemonkey.ws> <4CAF255A.1030103@codemonkey.ws> Date: Fri, 8 Oct 2010 08:50:01 -0700 Message-ID: Subject: Re: [Qemu-devel] [PATCH] ceph/rbd block driver for qemu-kvm (v4) From: Yehuda Sadeh Weinraub To: Anthony Liguori Cc: Sage Weil , Kevin Wolf , kvm@vger.kernel.org, qemu-devel@nongnu.org, ceph-devel@vger.kernel.org, Christian Brunner Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 08 Oct 2010 15:50:06 +0000 (UTC) diff --git a/block/rbd.c b/block/rbd.c index 13db079..164e547 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -315,13 +315,16 @@ done: static void rbd_aio_completion_cb(void *opaque) { BDRVRBDState *s = opaque; + RBDAIOCB *acb; - uint64_t val; ssize_t ret; do { - if ((ret = read(s->efd, &val, sizeof(val))) > 0) { - s->qemu_aio_count -= val; + if ((ret = read(s->efd, &acb, sizeof(acb))) > 0) { + s->qemu_aio_count --; + if (!acb->aiocnt && acb->bh) { + qemu_bh_schedule(acb->bh); + } } } while (ret < 0 && errno == EINTR); @@ -539,7 +542,6 @@ static void rbd_finish_aiocb(rados_completion_t c, RADOSCB *rcb) { RBDAIOCB *acb = rcb->acb; int64_t r; - uint64_t buf = 1; int i;