qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: use DIV_ROUND_UP in bdrv_co_do_readv
@ 2013-09-26 11:55 Fam Zheng
  2013-09-26 12:05 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Fam Zheng @ 2013-09-26 11:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index ea4956d..fe7b060 100644
--- a/block.c
+++ b/block.c
@@ -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,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] block: use DIV_ROUND_UP in bdrv_co_do_readv
  2013-09-26 11:55 [Qemu-devel] [PATCH] block: use DIV_ROUND_UP in bdrv_co_do_readv Fam Zheng
@ 2013-09-26 12:05 ` Eric Blake
  2013-09-26 12:11   ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2013-09-26 12:05 UTC (permalink / raw)
  To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

On 09/26/2013 05:55 AM, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index ea4956d..fe7b060 100644
> --- a/block.c
> +++ b/block.c
> @@ -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 <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] block: use DIV_ROUND_UP in bdrv_co_do_readv
  2013-09-26 12:05 ` Eric Blake
@ 2013-09-26 12:11   ` Kevin Wolf
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2013-09-26 12:11 UTC (permalink / raw)
  To: Eric Blake; +Cc: Fam Zheng, qemu-devel, stefanha

Am 26.09.2013 um 14:05 hat Eric Blake geschrieben:
> On 09/26/2013 05:55 AM, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  block.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/block.c b/block.c
> > index ea4956d..fe7b060 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -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 <eblake@redhat.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-26 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-26 11:55 [Qemu-devel] [PATCH] block: use DIV_ROUND_UP in bdrv_co_do_readv Fam Zheng
2013-09-26 12:05 ` Eric Blake
2013-09-26 12:11   ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).