|
|
9ae3a8 |
From 707398814bf924b6c430a49897171d1322011bff Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 26 Sep 2013 19:55:33 +0800
|
|
|
9ae3a8 |
Subject: [PATCH 18/37] block: use DIV_ROUND_UP in bdrv_co_do_readv
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1392117622-28812-19-git-send-email-kwolf@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 57183
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 18/37] block: use DIV_ROUND_UP in bdrv_co_do_readv
|
|
|
9ae3a8 |
Bugzilla: 748906
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit d055a1fec37ec84fd3e87d48a0e766a9ff8369c4)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block.c | 2 +-
|
|
|
9ae3a8 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block.c | 2 +-
|
|
|
9ae3a8 |
1 files changed, 1 insertions(+), 1 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block.c b/block.c
|
|
|
9ae3a8 |
index 645bcd0..feeab4e 100644
|
|
|
9ae3a8 |
--- a/block.c
|
|
|
9ae3a8 |
+++ b/block.c
|
|
|
9ae3a8 |
@@ -2795,7 +2795,7 @@ static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs,
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- total_sectors = (len + BDRV_SECTOR_SIZE - 1) >> BDRV_SECTOR_BITS;
|
|
|
9ae3a8 |
+ total_sectors = DIV_ROUND_UP(len, BDRV_SECTOR_SIZE);
|
|
|
9ae3a8 |
max_nb_sectors = MAX(0, total_sectors - sector_num);
|
|
|
9ae3a8 |
if (max_nb_sectors > 0) {
|
|
|
9ae3a8 |
ret = drv->bdrv_co_readv(bs, sector_num,
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|