block: use DIV_ROUND_UP in bdrv_co_do_readv
PATCH 1/1 block: use DIV_ROUND_UP in bdrv_co_do_readv
Signed-off-by Fam Zheng <[email protected]>
--- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +1 -1
@@ -2669,7 +2669,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,
Signature · 1 line
1.8.3.1
Quoted 10 lines · Fam Zheng
Signed-off-by Fam Zheng <[email protected]>--- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block.c +0
-0
block.c static int coroutine_fn bdrv_co_do_readv(BlockDriverState *bs, · line 2672
Quoted 5 lines
block.c +1
-1@@ -2669,7 +2669,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 );
Reviewed-by Eric Blake <[email protected]>
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Kevin Wolf
AppliedAm 26.09.2013 um 14:05 hat Eric Blake geschrieben:
Quoted 14 lines · Fam Zheng
Quoted 13 lines
Signed-off-by Fam Zheng <[email protected]>--- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block.c +0
-0@@ -2669,7 +2669,7 @@ static int coroutine_fn bdrv_co_do_readv(BlockDriverState *bs, goto out; }
Quoted 4 lines
block.c static int coroutine_fn bdrv_co_do_readv(BlockDriverState *bs, · line 2672
Quoted 2 lines
block.c +1
-1- total_sectors = (len +BDRV_SECTOR_SIZE -1 ) >>BDRV_SECTOR_BITS ; + total_sectors =DIV_ROUND_UP (len,BDRV_SECTOR_SIZE );Reviewed-by Eric Blake <[email protected]>
Thanks, applied to the block branch.
Kevin