Received: from eggs.gnu.org ([2001:4830:134:3::10]:53861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF2mG-0006Xw-Is for qemu-devel@nongnu.org; Thu, 29 Aug 2013 10:00:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF2m7-00083n-I0 for qemu-devel@nongnu.org; Thu, 29 Aug 2013 10:00:47 -0400 Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]:52176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF2m7-00083b-Au for qemu-devel@nongnu.org; Thu, 29 Aug 2013 10:00:39 -0400 Received: by mail-ee0-f45.google.com with SMTP id c50so271699eek.4 for ; Thu, 29 Aug 2013 07:00:38 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 29 Aug 2013 16:00:03 +0200 Message-Id: <1377784821-29561-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1377784821-29561-1-git-send-email-pbonzini@redhat.com> References: <1377784821-29561-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v4 03/21] cow: do not call bdrv_co_is_allocated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com As we change bdrv_is_allocated to gather more information from bs and bs->file, it will become a bit slower. It is still appropriate for online jobs, but not for reads/writes. Call the internal function instead. Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- v3->v4: remove forward declaration block/cow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/cow.c b/block/cow.c index 9ae2d6a..55bac50 100644 --- a/block/cow.c +++ b/block/cow.c @@ -212,7 +212,7 @@ static int coroutine_fn cow_read(BlockDriverState *bs, int64_t sector_num, int ret, n; while (nb_sectors > 0) { - if (bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n)) { + if (cow_co_is_allocated(bs, sector_num, nb_sectors, &n)) { ret = bdrv_pread(bs->file, s->cow_sectors_offset + sector_num * 512, buf, n * 512); -- 1.8.3.1