diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-06-06 00:04:55 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-06-15 14:03:43 +0200 |
commit | 6af4e9ead4ec9491259c9861b1b35f9abee24a66 (patch) | |
tree | e73675471adb5001272bbfcbab116da8d8acf829 /block/qcow2-refcount.c | |
parent | 7cdd481cdf15d610f83e38f15c7e7979420c6ac0 (diff) |
qcow2: always operate caches in writeback mode
Writethrough does not need special-casing anymore in the qcow2 caches.
The block layer adds flushes after every guest-initiated data write,
and these will also flush the qcow2 caches to the OS.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r-- | block/qcow2-refcount.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 5d6ea72780..66f391597c 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -726,13 +726,6 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, int64_t old_offset, old_l2_offset; int i, j, l1_modified = 0, nb_csectors, refcount; int ret; - bool old_l2_writethrough, old_refcount_writethrough; - - /* Switch caches to writeback mode during update */ - old_l2_writethrough = - qcow2_cache_set_writethrough(bs, s->l2_table_cache, false); - old_refcount_writethrough = - qcow2_cache_set_writethrough(bs, s->refcount_block_cache, false); l2_table = NULL; l1_table = NULL; @@ -856,11 +849,6 @@ fail: qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table); } - /* Enable writethrough cache mode again */ - qcow2_cache_set_writethrough(bs, s->l2_table_cache, old_l2_writethrough); - qcow2_cache_set_writethrough(bs, s->refcount_block_cache, - old_refcount_writethrough); - /* Update L1 only if it isn't deleted anyway (addend = -1) */ if (addend >= 0 && l1_modified) { for(i = 0; i < l1_size; i++) |