qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: jazeltq@gmail.com
Cc: jdurgin@redhat.com, dillaman@redhat.com, kwolf@redhat.com,
	mreitz@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org,
	ceph-devel@vger.kernel.org, tianqing <tianqing@unitedstack.com>
Subject: Re: [Qemu-devel] [RFC v6] RBD: Add support readv,writev for rbd
Date: Mon, 20 Feb 2017 23:50:21 -0500	[thread overview]
Message-ID: <20170221045021.GN19045@localhost.localdomain> (raw)
In-Reply-To: <20170221034336.10097-1-jazeltq@gmail.com>

On Tue, Feb 21, 2017 at 11:43:36AM +0800, jazeltq@gmail.com wrote:
> From: tianqing <tianqing@unitedstack.com>
> 
> Rbd can do readv and writev directly, so wo do not need to transform
> iov to buf or vice versa any more.
> 
> Signed-off-by: tianqing <tianqing@unitedstack.com>
> ---
>  block/rbd.c | 79 ++++++++++++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 54 insertions(+), 25 deletions(-)
> 


[...]

>      case RBD_AIO_WRITE:
> -        r = rbd_aio_write(s->image, off, size, buf, c);
> +        if(!LIBRBD_USE_IOVEC)
> +            r = rbd_aio_write(s->image, off, size, rcb->buf, c);
> +        else
> +            r = rbd_aio_writev(s->image, qiov->iov, qiov->niov, off, c);
>          break;
>      case RBD_AIO_READ:
> -        r = rbd_aio_read(s->image, off, size, buf, c);
> +        if(!LIBRBD_USE_IOVEC)
> +            r = rbd_aio_read(s->image, off, size, rcb->buf, c);
> +        else
> +            r = rbd_aio_readv(s->image, qiov->iov, qiov->niov, off, c);

These will need to stay #ifdef's since they are new symbols.

>          break;
>      case RBD_AIO_DISCARD:
>          r = rbd_aio_discard_wrapper(s->image, off, size, c);
> @@ -712,14 +740,15 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
>      if (r < 0) {
>          goto failed_completion;
>      }
> -
>      return &acb->common;
>  
>  failed_completion:
>      rbd_aio_release(c);
>  failed:
>      g_free(rcb);
> -    qemu_vfree(acb->bounce);
> +    if(!LIBRBD_USE_IOVEC)
> +        qemu_vfree(acb->bounce);
> +
>      qemu_aio_unref(acb);
>      return NULL;
>  }
> -- 
> 2.10.2
>

(Also code formatting as pointed out by patchew)

  parent reply	other threads:[~2017-02-21  4:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  3:43 [Qemu-devel] [RFC v6] RBD: Add support readv,writev for rbd jazeltq
2017-02-21  3:50 ` no-reply
2017-02-21  4:01 ` no-reply
2017-02-21  4:50 ` Jeff Cody [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-02-21  6:50 jazeltq
2017-02-24  3:52 ` Jeff Cody
2017-02-24  6:09   ` Jaze Lee
2017-02-24 11:42     ` Jeff Cody
2017-02-24 12:51       ` Jaze Lee

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=20170221045021.GN19045@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dillaman@redhat.com \
    --cc=jazeltq@gmail.com \
    --cc=jdurgin@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tianqing@unitedstack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).