[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [RFC PATCH 02/16] block: Set dirty before doing write
From: |
Fam Zheng |
Subject: |
[Qemu-block] [RFC PATCH 02/16] block: Set dirty before doing write |
Date: |
Tue, 26 Jan 2016 18:38:11 +0800 |
So that driver can write the dirty bits into persistent dirty bitmaps in
the write callback.
Signed-off-by: Fam Zheng <address@hidden>
---
block/io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/io.c b/block/io.c
index 343ff1f..b964e7e 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1164,6 +1164,8 @@ static int coroutine_fn
bdrv_aligned_pwritev(BlockDriverState *bs,
}
}
+ bdrv_set_dirty(bs, sector_num, nb_sectors);
+
if (ret < 0) {
/* Do nothing, write notifier decided to fail this request */
} else if (flags & BDRV_REQ_ZERO_WRITE) {
@@ -1179,8 +1181,6 @@ static int coroutine_fn
bdrv_aligned_pwritev(BlockDriverState *bs,
ret = bdrv_co_flush(bs);
}
- bdrv_set_dirty(bs, sector_num, nb_sectors);
-
if (bs->wr_highest_offset < offset + bytes) {
bs->wr_highest_offset = offset + bytes;
}
--
2.4.3
- [Qemu-block] [RFC PATCH 00/16] Qemu Bit Map (QBM) - an overlay format for persistent dirty bitmap, Fam Zheng, 2016/01/26
- [Qemu-block] [RFC PATCH 01/16] doc: Add QBM format specification, Fam Zheng, 2016/01/26
- [Qemu-block] [RFC PATCH 02/16] block: Set dirty before doing write,
Fam Zheng <=
- [Qemu-block] [RFC PATCH 03/16] block: Allow .bdrv_close callback to release dirty bitmaps, Fam Zheng, 2016/01/26
- [Qemu-block] [RFC PATCH 04/16] block: Move filename_decompose to block.c, Fam Zheng, 2016/01/26
- [Qemu-block] [RFC PATCH 05/16] block: Make bdrv_get_cluster_size public, Fam Zheng, 2016/01/26
- [Qemu-block] [RFC PATCH 06/16] block: Introduce bdrv_dirty_bitmap_set_persistent, Fam Zheng, 2016/01/26
- [Qemu-block] [RFC PATCH 07/16] block: Only swap non-persistent dirty bitmaps, Fam Zheng, 2016/01/26
- [Qemu-block] [RFC PATCH 08/16] qmp: Add optional parameter "persistent" in block-dirty-bitmap-add, Fam Zheng, 2016/01/26