aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2012-03-02 14:10:54 +0100
committerKevin Wolf <kwolf@redhat.com>2012-03-12 15:14:07 +0100
commit250196f19c6e7df12965d74a5073e10aba06c802 (patch)
tree53e93bcbfbf9355fe6d3f09e6045c3036959434c /block/qcow2.h
parent256900b16b0264af9e165bceabbf74dcece4ea38 (diff)
qcow2: Reduce number of I/O requests
If the first part of a write request is allocated, but the second isn't and it can be allocated so that the resulting area is contiguous, handle it at once. This is a common case for sequential writes. After this patch, alloc_cluster_offset() only checks if the clusters are already allocated or how many new clusters can be allocated contigouosly. The actual cluster allocation is split off into a new function do_alloc_cluster_offset(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 5129e3eab9..e4ac366cfc 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -155,6 +155,7 @@ typedef struct QCowL2Meta
{
uint64_t offset;
uint64_t cluster_offset;
+ uint64_t alloc_offset;
int n_start;
int nb_available;
int nb_clusters;