qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 1/2] COW: Speed up writes


From: Charlie Shepherd
Subject: Re: [Qemu-devel] [PATCH v3 1/2] COW: Speed up writes
Date: Fri, 15 Nov 2013 18:43:48 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

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 <address@hidden>
---
  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 via email to

[Prev in Thread] Current Thread [Next in Thread]