All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charlie Shepherd <charlie@ctshepherd.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: pbonzini@redhat.com, gabriel@kerneis.info, qemu-devel@nongnu.org,
	stefanha@gmail.com
Subject: Re: [Qemu-devel] [PATCH v3 1/2] COW: Speed up writes
Date: Fri, 15 Nov 2013 18:43:48 +0000	[thread overview]
Message-ID: <52866B64.6020402@ctshepherd.com> (raw)
In-Reply-To: <20131113125912.GC2633@dhcp-200-207.str.redhat.com>

On 13/11/2013 12:59, Kevin Wolf wrote:
> 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 <charlie@ctshepherd.com>
>> ---
>>   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)

Sorry I should have caught that, resending a new version.


Charlie

  reply	other threads:[~2013-11-15 18:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 15:59 [Qemu-devel] [PATCH v3 0/2] COW: Speed up writes Charlie Shepherd
2013-11-06 15:59 ` [Qemu-devel] [PATCH v3 1/2] " Charlie Shepherd
2013-11-06 16:17   ` Paolo Bonzini
2013-11-06 16:24     ` Charlie Shepherd
2013-11-13 12:59   ` Kevin Wolf
2013-11-15 18:43     ` Charlie Shepherd [this message]
2013-11-06 15:59 ` [Qemu-devel] [PATCH v3 2/2] COW: Extend checking allocated bits to beyond one sector Charlie Shepherd
2013-11-11 16:39 ` [Qemu-devel] [PATCH v3 0/2] COW: Speed up writes Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52866B64.6020402@ctshepherd.com \
    --to=charlie@ctshepherd.com \
    --cc=gabriel@kerneis.info \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.