]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
qcow2: Factor next_refcount_table_size out
authorKevin Wolf <kwolf@redhat.com>
Tue, 23 Feb 2010 15:40:52 +0000 (16:40 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 23 Feb 2010 19:23:29 +0000 (13:23 -0600)
commit05121aedc41f87e44e41e9cef55f2e49ce7ba94e
tree1d42043cc823aa09aa36218e51157527f5457157
parent1d9000e8238ffc346b0a08f4c0619c4e5711a7dc
qcow2: Factor next_refcount_table_size out

When the refcount table grows, it doesn't only grow by one entry but reserves
some space for future refcount blocks. The algorithm to calculate the number of
entries stays the same with the fixes, so factor it out before replacing the
rest.

As Juan suggested take the opportunity to simplify the code a bit.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/qcow2-refcount.c