qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] block: change variable names in BlockDriverS


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2] block: change variable names in BlockDriverState
Date: Fri, 9 Jun 2017 10:41:13 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

On Fri, Jun 09, 2017 at 02:22:55AM +0300, Manos Pitsidianakis wrote:
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 0b48b64..1a74339 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -416,16 +416,16 @@ static void ide_issue_trim_cb(void *opaque, int ret)
>                  /* 6-byte LBA + 2-byte range per entry */
>                  uint64_t entry = le64_to_cpu(buffer[i]);
>                  uint64_t sector = entry & 0x0000ffffffffffffULL;
> -                uint16_t count = entry >> 48;
> +                uint16_t bytes = entry >> 48;
>  
> -                if (count == 0) {
> +                if (bytes == 0) {
>                      continue;
>                  }
>  
>                  /* Got an entry! Submit and exit.  */
>                  iocb->aiocb = blk_aio_pdiscard(iocb->blk,
>                                                 sector << BDRV_SECTOR_BITS,
> -                                               count << BDRV_SECTOR_BITS,
> +                                               bytes << BDRV_SECTOR_BITS,
>                                                 ide_issue_trim_cb, opaque);
>                  return;
>              }

This change looks suspicious:

  bytes << BDRV_SECTOR_BITS

Therefore 'bytes' is actually in units of sectors!

Please drop this hunk.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]