All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: stefanha@redhat.com, famz@redhat.com, mreitz@redhat.com,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev
Date: Tue, 14 Jun 2016 08:15:18 -0600	[thread overview]
Message-ID: <57601176.6050002@redhat.com> (raw)
In-Reply-To: <1465911155-19002-6-git-send-email-kwolf@redhat.com>

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

On 06/14/2016 07:32 AM, Kevin Wolf wrote:
> The raw-posix block driver actually supports byte-aligned requests now
> on non-O_DIRECT images, like it already (and previously incorrectly)
> claimed in bs->request_alignment.
> 
> For some block drivers this means that a RMW cycle can be avoided when
> they write sub-sector metadata e.g. for cluster allocation.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/linux-aio.c |  7 ++-----
>  block/raw-aio.h   |  3 +--
>  block/raw-posix.c | 43 +++++++++++++++++++++++--------------------
>  3 files changed, 26 insertions(+), 27 deletions(-)
> 

> -static int coroutine_fn raw_co_readv(BlockDriverState *bs, int64_t sector_num,
> -                                     int nb_sectors, QEMUIOVector *qiov)
> +static int coroutine_fn raw_co_preadv(BlockDriverState *bs, uint64_t offset,
> +                                      uint64_t bytes, QEMUIOVector *qiov,
> +                                      int flags)
>  {
> -    return raw_co_rw(bs, sector_num, nb_sectors, qiov, QEMU_AIO_READ);
> +    return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_READ);
>  }
>  
> -static int coroutine_fn raw_co_writev(BlockDriverState *bs, int64_t sector_num,
> -                                      int nb_sectors, QEMUIOVector *qiov)
> +static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t offset,
> +                                       uint64_t bytes, QEMUIOVector *qiov,
> +                                       int flags)
>  {
> -    return raw_co_rw(bs, sector_num, nb_sectors, qiov, QEMU_AIO_WRITE);
> +    assert(flags == 0);
> +    return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_WRITE);
>  }

Looks odd to assert !flags on pwritev but not on preadv.  Minor enough
that you could fix on pull request.

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: 604 bytes --]

  reply	other threads:[~2016-06-14 14:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 13:32 [Qemu-devel] [PATCH v2 0/6] block: Enable byte granularity I/O Kevin Wolf
2016-06-14 13:32 ` [Qemu-devel] [PATCH v2 1/6] block: Byte-based bdrv_co_do_copy_on_readv() Kevin Wolf
2016-06-14 13:32 ` [Qemu-devel] [PATCH v2 2/6] block: Prepare bdrv_aligned_preadv() for byte-aligned requests Kevin Wolf
2016-06-14 13:32 ` [Qemu-devel] [PATCH v2 3/6] block: Prepare bdrv_aligned_pwritev() " Kevin Wolf
2016-06-14 13:32 ` [Qemu-devel] [PATCH v2 4/6] raw-posix: Switch to bdrv_co_* interfaces Kevin Wolf
2016-06-14 14:10   ` Eric Blake
2016-06-14 13:32 ` [Qemu-devel] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev Kevin Wolf
2016-06-14 14:15   ` Eric Blake [this message]
2016-06-14 13:32 ` [Qemu-devel] [PATCH v2 6/6] block: Don't enforce 512 byte minimum alignment Kevin Wolf
2016-06-15  9:02 ` [Qemu-devel] [PATCH v2 0/6] block: Enable byte granularity I/O Stefan Hajnoczi
2016-06-15 10:33   ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57601176.6050002@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.