From 48a9eea657b6533556026d5eda813736ab36844b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 18 Oct 2013 08:14:28 +0200 Subject: [PATCH 03/81] cow: do not call bdrv_co_is_allocated RH-Author: Paolo Bonzini Message-id: <1382084091-16636-4-git-send-email-pbonzini@redhat.com> Patchwork-id: 54987 O-Subject: [RHEL 7.0 qemu-kvm PATCH 03/26] cow: do not call bdrv_co_is_allocated Bugzilla: 989646 RH-Acked-by: Stefan Hajnoczi RH-Acked-by: Max Reitz RH-Acked-by: Kevin Wolf As we change bdrv_is_allocated to gather more information from bs and bs->file, it will become a bit slower. It is still appropriate for online jobs, but not for reads/writes. Call the internal function instead. Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini (cherry picked from commit e641c1e81e54fc14908ff6785ef7d51e42c2e1bb) --- block/cow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Miroslav Rezanina --- block/cow.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/cow.c b/block/cow.c index 2f72334..21bceaa 100644 --- a/block/cow.c +++ b/block/cow.c @@ -212,7 +212,7 @@ static int coroutine_fn cow_read(BlockDriverState *bs, int64_t sector_num, int ret, n; while (nb_sectors > 0) { - if (bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n)) { + if (cow_co_is_allocated(bs, sector_num, nb_sectors, &n)) { ret = bdrv_pread(bs->file, s->cow_sectors_offset + sector_num * 512, buf, n * 512); -- 1.7.1