projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c01dbcc
)
block: use DIV_ROUND_UP in bdrv_co_do_readv
author
Fam Zheng
<famz@redhat.com>
Thu, 26 Sep 2013 11:55:33 +0000
(19:55 +0800)
committer
Kevin Wolf
<kwolf@redhat.com>
Thu, 26 Sep 2013 12:11:06 +0000
(14:11 +0200)
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
patch
|
blob
|
history
diff --git
a/block.c
b/block.c
index 4833b37ab80c168813cf478e78cbf99dbb24cb5e..93e113ad7c0e63eed6430777da67fda694479438 100644
(file)
--- a/
block.c
+++ b/
block.c
@@
-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,