* [Qemu-devel] [4673] Remove dead-code (else-block) from block-qcow.c, by Marc Bevand.
@ 2008-06-05 22:00 Thiemo Seufer
0 siblings, 0 replies; only message in thread
From: Thiemo Seufer @ 2008-06-05 22:00 UTC (permalink / raw)
To: qemu-devel
Revision: 4673
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4673
Author: ths
Date: 2008-06-05 22:00:45 +0000 (Thu, 05 Jun 2008)
Log Message:
-----------
Remove dead-code (else-block) from block-qcow.c, by Marc Bevand.
Modified Paths:
--------------
trunk/block-qcow.c
Modified: trunk/block-qcow.c
===================================================================
--- trunk/block-qcow.c 2008-06-05 21:53:49 UTC (rev 4672)
+++ trunk/block-qcow.c 2008-06-05 22:00:45 UTC (rev 4673)
@@ -339,33 +339,28 @@
return -1;
} else {
cluster_offset = bdrv_getlength(s->hd);
- if (allocate == 1) {
- /* round to cluster size */
- cluster_offset = (cluster_offset + s->cluster_size - 1) &
- ~(s->cluster_size - 1);
- bdrv_truncate(s->hd, cluster_offset + s->cluster_size);
- /* if encrypted, we must initialize the cluster
- content which won't be written */
- if (s->crypt_method &&
- (n_end - n_start) < s->cluster_sectors) {
- uint64_t start_sect;
- start_sect = (offset & ~(s->cluster_size - 1)) >> 9;
- memset(s->cluster_data + 512, 0x00, 512);
- for(i = 0; i < s->cluster_sectors; i++) {
- if (i < n_start || i >= n_end) {
- encrypt_sectors(s, start_sect + i,
- s->cluster_data,
- s->cluster_data + 512, 1, 1,
- &s->aes_encrypt_key);
- if (bdrv_pwrite(s->hd, cluster_offset + i * 512,
- s->cluster_data, 512) != 512)
- return -1;
- }
+ /* round to cluster size */
+ cluster_offset = (cluster_offset + s->cluster_size - 1) &
+ ~(s->cluster_size - 1);
+ bdrv_truncate(s->hd, cluster_offset + s->cluster_size);
+ /* if encrypted, we must initialize the cluster
+ content which won't be written */
+ if (s->crypt_method &&
+ (n_end - n_start) < s->cluster_sectors) {
+ uint64_t start_sect;
+ start_sect = (offset & ~(s->cluster_size - 1)) >> 9;
+ memset(s->cluster_data + 512, 0x00, 512);
+ for(i = 0; i < s->cluster_sectors; i++) {
+ if (i < n_start || i >= n_end) {
+ encrypt_sectors(s, start_sect + i,
+ s->cluster_data,
+ s->cluster_data + 512, 1, 1,
+ &s->aes_encrypt_key);
+ if (bdrv_pwrite(s->hd, cluster_offset + i * 512,
+ s->cluster_data, 512) != 512)
+ return -1;
}
}
- } else {
- cluster_offset |= QCOW_OFLAG_COMPRESSED |
- (uint64_t)compressed_size << (63 - s->cluster_bits);
}
}
/* update L2 table */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-05 22:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-05 22:00 [Qemu-devel] [4673] Remove dead-code (else-block) from block-qcow.c, by Marc Bevand Thiemo Seufer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).