[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v6 07/20] scsi-disk: Switch to byte-based aio bl
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH v6 07/20] scsi-disk: Switch to byte-based aio block access |
Date: |
Fri, 6 May 2016 16:49:15 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 06.05.2016 um 16:18 hat Eric Blake geschrieben:
> On 05/06/2016 06:50 AM, Kevin Wolf wrote:
> > Am 05.05.2016 um 01:55 hat Eric Blake geschrieben:
> >> @@ -1730,13 +1730,11 @@ static void scsi_write_same_complete(void *opaque,
> >> int ret)
> >> if (data->iov.iov_len) {
> >> block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct,
> >> data->iov.iov_len, BLOCK_ACCT_WRITE);
> >> - /* blk_aio_write doesn't like the qiov size being different from
> >> - * nb_sectors, make sure they match.
> >> - */
> >
> > Wouldn't it be better to update the comment instead of deleting it? If I
> > understand correctly, this additional qemu_iovec_init_external() is for
> > the last part of an unaligned WRITE SAME request, where the qiov can
> > become shorter than in the previous iterations.
>
> The comment mattered when you were passing two sizes to blk_aio_writev
> (one embedded in data->qiov, and one in terms of sectors as a direct
> argument); the block layer asserted the two were equal. But now that we
> are handling bytes, we pass in a single size (that of data->qiov), so
> the comment no longer makes sense.
Yes, with the current text it doesn't make sense any more. But it
explains why we have another qemu_iovec_init_external() here, and as
that call remains, it would still be good to have an explanation.
Or maybe it's obvious, don't know...
> >
> >> qemu_iovec_init_external(&data->qiov, &data->iov, 1);
> >> - r->req.aiocb = blk_aio_writev(s->qdev.conf.blk, data->sector,
> >> - &data->qiov, data->iov.iov_len /
> >> 512,
> >> - scsi_write_same_complete, data);
> >> + r->req.aiocb = blk_aio_pwritev(s->qdev.conf.blk,
> >> + data->sector << BDRV_SECTOR_BITS,
> >> + &data->qiov, 0,
>
> It caught me more than once while writing the patch that my new function
> replaced nb_sectors (the duplicated size) by flags, rather than adding a
> parameter (as it was harder to get the compiler to gripe about
> incomplete conversions, such as forgetting to s/write/pwrite/). But by
> the end of the series, when the old interface is gone, everything still
> compiles under the new name, so at least we're assured that the series
> worked on that front.
Yes, I was a bit worried that I might miss possible cases where you
still pass bytes instead of flags when the compiler can't complain about
them. I didn't see any, so hopefully that means it's good.
Kevin
pgp3IvDWNGgWi.pgp
Description: PGP signature
- Re: [Qemu-block] [PATCH v6 02/20] block: Drop private ioctl-only members of BlockRequest, (continued)
- [Qemu-block] [PATCH v6 03/20] block: Switch blk_read_unthrottled() to byte interface, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 04/20] block: Switch blk_*write_zeroes() to byte interface, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 05/20] block: Introduce byte-based aio read/write, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 06/20] ide: Switch to byte-based aio block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 07/20] scsi-disk: Switch to byte-based aio block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 01/20] block: Allow BDRV_REQ_FUA through blk_pwrite(), Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 08/20] virtio: Switch to byte-based aio block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 09/20] xen_disk: Switch to byte-based aio block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 10/20] fdc: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 11/20] nand: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 12/20] onenand: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 16/20] atapi: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 15/20] m25p80: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 18/20] qemu-img: Switch to byte-based block access, Eric Blake, 2016/05/04
- [Qemu-block] [PATCH v6 19/20] qemu-io: Switch to byte-based block access, Eric Blake, 2016/05/04