From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vga2Y-0007HT-4l for qemu-devel@nongnu.org; Wed, 13 Nov 2013 07:59:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vga2T-00061T-6k for qemu-devel@nongnu.org; Wed, 13 Nov 2013 07:59:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vga2S-0005z7-Tx for qemu-devel@nongnu.org; Wed, 13 Nov 2013 07:59:21 -0500 Date: Wed, 13 Nov 2013 13:59:12 +0100 From: Kevin Wolf Message-ID: <20131113125912.GC2633@dhcp-200-207.str.redhat.com> References: <1383753568-15844-1-git-send-email-charlie@ctshepherd.com> <1383753568-15844-2-git-send-email-charlie@ctshepherd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1383753568-15844-2-git-send-email-charlie@ctshepherd.com> Subject: Re: [Qemu-devel] [PATCH v3 1/2] COW: Speed up writes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Charlie Shepherd Cc: pbonzini@redhat.com, gabriel@kerneis.info, qemu-devel@nongnu.org, stefanha@gmail.com Am 06.11.2013 um 16:59 hat Charlie Shepherd geschrieben: > Process a whole sector's worth of COW bits by reading a sector, setting the bits after skipping > any already set bits, then writing it out again. Make sure we only flush once before writing > metadata, and only if we need to write metadata. > > Signed-off-by: Charlie Shepherd > --- > block/cow.c | 87 ++++++++++++++++++++++++++++++++++--------------------------- > 1 file changed, 49 insertions(+), 38 deletions(-) > @@ -204,18 +182,51 @@ static int64_t coroutine_fn cow_co_get_block_status(BlockDriverState *bs, > static int cow_update_bitmap(BlockDriverState *bs, int64_t sector_num, > int nb_sectors) > { > - int error = 0; > - int i; > + int64_t bitnum = sector_num + sizeof(struct cow_header_v2) * 8; > + uint64_t offset = (bitnum / 8) & -BDRV_SECTOR_SIZE; > bool first = true; > > - for (i = 0; i < nb_sectors; i++) { > - error = cow_set_bit(bs, sector_num + i, &first); > - if (error) { > - break; > + for ( ; nb_sectors; > + bitnum += sector_bits, > + nb_sectors -= sector_bits, > + offset += BDRV_SECTOR_SIZE) { block/cow.c: In function 'cow_update_bitmap': block/cow.c:206:23: error: 'sector_bits' undeclared (first use in this function) Kevin