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