aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-cache.c
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2015-05-11 15:54:58 +0300
committerKevin Wolf <kwolf@redhat.com>2015-05-22 17:08:01 +0200
commita3f1afb43a09e4577571c044c48f2ba9e6e4ad06 (patch)
treed53fd22a0e05be8ca23ab773f478ac1beea7b2fe /block/qcow2-cache.c
parent812e4082cae73e12fd425cace4fd3a715a7c1d32 (diff)
qcow2: make qcow2_cache_put() a void function
This function never receives an invalid table pointer, so we can make it void and remove all the error checking code. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2-cache.c')
-rw-r--r--block/qcow2-cache.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
index 121e6e9227..bde3c4fb13 100644
--- a/block/qcow2-cache.c
+++ b/block/qcow2-cache.c
@@ -330,14 +330,10 @@ int qcow2_cache_get_empty(BlockDriverState *bs, Qcow2Cache *c, uint64_t offset,
return qcow2_cache_do_get(bs, c, offset, table, false);
}
-int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table)
+void qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table)
{
int i = qcow2_cache_get_table_idx(bs, c, *table);
- if (c->entries[i].offset == 0) {
- return -ENOENT;
- }
-
c->entries[i].ref--;
*table = NULL;
@@ -346,7 +342,6 @@ int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table)
}
assert(c->entries[i].ref >= 0);
- return 0;
}
void qcow2_cache_entry_mark_dirty(BlockDriverState *bs, Qcow2Cache *c,