From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv20y-0003oa-Ak for qemu-devel@nongnu.org; Fri, 05 Jul 2013 05:09:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uv20x-0002Zk-6m for qemu-devel@nongnu.org; Fri, 05 Jul 2013 05:09:16 -0400 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:42074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv20x-0002Zg-0L for qemu-devel@nongnu.org; Fri, 05 Jul 2013 05:09:15 -0400 Received: by mail-ea0-f171.google.com with SMTP id m14so1328774eaj.2 for ; Fri, 05 Jul 2013 02:09:14 -0700 (PDT) Date: Fri, 5 Jul 2013 11:09:10 +0200 From: Stefan Hajnoczi Message-ID: <20130705090910.GA11252@stefanha-thinkpad.redhat.com> References: <1372862071-28225-1-git-send-email-pbonzini@redhat.com> <1372862071-28225-2-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1372862071-28225-2-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 01/17] cow: make reads go at a decent speed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com On Wed, Jul 03, 2013 at 04:34:15PM +0200, Paolo Bonzini wrote: > @@ -146,23 +159,20 @@ static inline int is_bit_set(BlockDriverState *bs, int64_t bitnum) > static int coroutine_fn cow_co_is_allocated(BlockDriverState *bs, > int64_t sector_num, int nb_sectors, int *num_same) > { > + int64_t bitnum = sector_num + sizeof(struct cow_header_v2) * 8; > + uint64_t offset = (bitnum / 8) & -BDRV_SECTOR_SIZE; > + uint8_t bitmap[512]; Please use BDRV_SECTOR_SIZE, you used it one line above but then switched to literal 512.