[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 10/13] raw-posix: Convert to bdrv_co_pwrite_z
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [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
- [Qemu-devel] [PATCH v2 00/13] Kill sector-based write_zeroes, Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 01/13] iscsi: Use block size as minimum zero/discard alignment, Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 06/13] qcow2: Convert to bdrv_co_pwrite_zeroes(), Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 02/13] block: Track write zero limits in bytes, Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 03/13] block: Add .bdrv_co_pwrite_zeroes(), Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 10/13] raw-posix: Convert to bdrv_co_pwrite_zeroes(), Eric Blake, 2016/06/01
- Re: [Qemu-devel] [PATCH v2 10/13] raw-posix: Convert to bdrv_co_pwrite_zeroes(),
Kevin Wolf <=
- [Qemu-devel] [PATCH v2 07/13] blkreplay: Convert to bdrv_co_pwrite_zeroes(), Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 05/13] iscsi: Convert to bdrv_co_pwrite_zeroes(), Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 04/13] block: Switch bdrv_write_zeroes() to byte interface, Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 08/13] gluster: Convert to bdrv_co_pwrite_zeroes(), Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 09/13] qed: Convert to bdrv_co_pwrite_zeroes(), Eric Blake, 2016/06/01
- [Qemu-devel] [PATCH v2 13/13] block: Kill bdrv_co_write_zeroes(), Eric Blake, 2016/06/01