[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [RFC PATCH 4/8] file-posix: Implement bdrv_co_copy_rang
From: |
Fam Zheng |
Subject: |
Re: [Qemu-block] [RFC PATCH 4/8] file-posix: Implement bdrv_co_copy_range |
Date: |
Mon, 9 Apr 2018 16:53:41 +0800 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Wed, 04/04 14:20, Stefan Hajnoczi wrote:
> On Thu, Mar 29, 2018 at 07:09:10PM +0800, Fam Zheng wrote:
> > +static ssize_t handle_aiocb_copy_range(RawPosixAIOData *aiocb)
> > +{
> > +#ifndef HAS_COPY_FILE_RANGE
> > + return -ENOTSUP;
> > +#else
> > + uint64_t bytes = aiocb->aio_nbytes;
> > + off_t in_off = aiocb->aio_offset;
> > + off_t out_off = aiocb->offset2;
> > +
> > + while (bytes) {
> > + ssize_t ret = copy_file_range(aiocb->aio_fildes, &in_off,
> > + aiocb->fd2, &out_off,
> > + bytes, 0);
> > + if (ret < 0) {
> > + return -errno;
> > + }
>
> EINTR should retry.
Will add (it is not listed in the manpage so I wasn't sure if it is necessary.)
Fam