On Tue, May 05, 2015 at 03:06:52PM +0200, Alberto Garcia wrote:
On Fri 01 May 2015 04:31:52 PM CEST, Stefan Hajnoczi wrote:
int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table)
{
-int i;
+int i = (*table - c-table_array) / c-table_size;
-for (i = 0;
On Fri 01 May 2015 04:31:52 PM CEST, Stefan Hajnoczi wrote:
int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table)
{
-int i;
+int i = (*table - c-table_array) / c-table_size;
-for (i = 0; i c-size; i++) {
-if (table_addr(c, i) == *table) {
-
On 04/30/2015 04:11 AM, Alberto Garcia wrote:
Since all tables are now stored together, it is possible to obtain
the position of a particular table directly from its address, so the
operation becomes O(1).
Signed-off-by: Alberto Garcia be...@igalia.com
---
block/qcow2-cache.c | 22