diff options
author | Fam Zheng <famz@redhat.com> | 2013-09-26 19:55:33 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-09-26 14:11:06 +0200 |
commit | d055a1fec37ec84fd3e87d48a0e766a9ff8369c4 (patch) | |
tree | c7e5845905dd1846438ea0dcc99998e1c47e8b5b /block.c | |
parent | c01dbccbad647be5784be39eb8fa0144732295db (diff) | |
download | qemu-d055a1fec37ec84fd3e87d48a0e766a9ff8369c4.zip qemu-d055a1fec37ec84fd3e87d48a0e766a9ff8369c4.tar.gz qemu-d055a1fec37ec84fd3e87d48a0e766a9ff8369c4.tar.bz2 |
block: use DIV_ROUND_UP in bdrv_co_do_readv
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2653,7 +2653,7 @@ static int coroutine_fn bdrv_co_do_readv(BlockDriverState *bs, goto out; } - total_sectors = (len + BDRV_SECTOR_SIZE - 1) >> BDRV_SECTOR_BITS; + total_sectors = DIV_ROUND_UP(len, BDRV_SECTOR_SIZE); max_nb_sectors = MAX(0, total_sectors - sector_num); if (max_nb_sectors > 0) { ret = drv->bdrv_co_readv(bs, sector_num, |