Re: [RFC v6] RBD: Add support readv,writev for rbd

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

 



On Tue, Feb 21, 2017 at 11:43:36AM +0800, jazeltq@xxxxxxxxx wrote:
> From: tianqing <tianqing@xxxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxxx>
> ---
>  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)
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux