qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2 10/13] raw-posix: Convert to bdrv_co_pwrite_z


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH v2 10/13] raw-posix: Convert to bdrv_co_pwrite_zeroes()
Date: Fri, 3 Jun 2016 18:21:22 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 01.06.2016 um 23:10 hat Eric Blake geschrieben:
> Another step on our continuing quest to switch to byte-based
> interfaces.
> 
> Signed-off-by: Eric Blake <address@hidden>
> ---
>  block/raw-posix.c | 34 +++++++++++++++++-----------------
>  trace-events      |  2 +-
>  2 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index a4f5a1b..8bfcb4a 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -1252,8 +1252,8 @@ static int aio_worker(void *arg)
>  }
> 
>  static int paio_submit_co(BlockDriverState *bs, int fd,
> -        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
> -        int type)
> +                          int64_t offset, QEMUIOVector *qiov,
> +                          int count, int type)
>  {
>      RawPosixAIOData *acb = g_new(RawPosixAIOData, 1);
>      ThreadPool *pool;
> @@ -1262,16 +1262,16 @@ static int paio_submit_co(BlockDriverState *bs, int 
> fd,
>      acb->aio_type = type;
>      acb->aio_fildes = fd;
> 
> -    acb->aio_nbytes = nb_sectors * BDRV_SECTOR_SIZE;
> -    acb->aio_offset = sector_num * BDRV_SECTOR_SIZE;
> +    acb->aio_nbytes = count;
> +    acb->aio_offset = offset;
> 
>      if (qiov) {
>          acb->aio_iov = qiov->iov;
>          acb->aio_niov = qiov->niov;
> -        assert(qiov->size == acb->aio_nbytes);
> +        assert(qiov->size == count);
>      }
> 
> -    trace_paio_submit_co(sector_num, nb_sectors, type);
> +    trace_paio_submit_co(offset, qiov->size, type);

As discussed on IRC, I'm fixing this up in my branch with
s/qiov->size/count/ because qiov can be NULL.

This fixes qemu-iotests 048 for raw.

>      pool = aio_get_thread_pool(bdrv_get_aio_context(bs));
>      return thread_pool_submit_co(pool, aio_worker, acb);
>  }

Kevin



reply via email to

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