From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3nOy-0006JL-BR for qemu-devel@nongnu.org; Mon, 29 Jul 2013 09:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3nOr-0007fJ-Op for qemu-devel@nongnu.org; Mon, 29 Jul 2013 09:22:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3nOr-0007fA-Gt for qemu-devel@nongnu.org; Mon, 29 Jul 2013 09:22:09 -0400 Date: Mon, 29 Jul 2013 15:22:01 +0200 From: Kevin Wolf Message-ID: <20130729132201.GF10467@dhcp-200-207.str.redhat.com> References: <1374762197-7261-1-git-send-email-pbonzini@redhat.com> <1374762197-7261-4-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1374762197-7261-4-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 03/19] cow: do not call bdrv_co_is_allocated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com Am 25.07.2013 um 16:23 hat Paolo Bonzini geschrieben: > 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 > --- > block/cow.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/block/cow.c b/block/cow.c > index 9ae2d6a..9797f71 100644 > --- a/block/cow.c > +++ b/block/cow.c > @@ -46,6 +46,9 @@ typedef struct BDRVCowState { > int64_t cow_sectors_offset; > } BDRVCowState; > > +static int coroutine_fn cow_co_is_allocated(BlockDriverState *bs, > + int64_t sector_num, int nb_sectors, int *num_same); This forward declaration seems unnecessary. Kevin