qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Peter Lieven <pl@kamp.de>, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/9] file-posix: Implement bdrv_co_copy_range
Date: Fri, 11 May 2018 15:20:05 +0800	[thread overview]
Message-ID: <20180511072005.GB28054@lemon.usersys.redhat.com> (raw)
In-Reply-To: <20180510085019.GF1296@stefanha-x1.localdomain>

On Thu, 05/10 09:50, Stefan Hajnoczi wrote:
> On Wed, May 09, 2018 at 10:58:10PM +0800, Fam Zheng wrote:
> > +static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
> > +                             off_t *out_off, size_t len, unsigned int flags)
> > +{
> > +#ifdef __NR_copy_file_range
> > +    return syscall(__NR_copy_file_range, in_fd, in_off, out_fd,
> > +                   out_off, len, flags);
> > +#else
> > +    errno = ENOSYS;
> > +    return -1;
> > +#endif
> > +}
> > +
> > +static ssize_t handle_aiocb_copy_range(RawPosixAIOData *aiocb)
> > +{
> > +    uint64_t bytes = aiocb->aio_nbytes;
> > +    off_t in_off = aiocb->aio_offset;
> > +    off_t out_off = aiocb->aio_offset2;
> > +
> > +    while (bytes) {
> > +        ssize_t ret = copy_file_range(aiocb->aio_fildes, &in_off,
> > +                                      aiocb->aio_fd2, &out_off,
> > +                                      bytes, 0);
> > +        if (ret == -EINTR) {
> > +            continue;
> > +        }
> > +        if (ret < 0) {
> > +            return -errno;
> 
> Convert ENOSYS to ENOTSUP?

Sounds good.

  reply	other threads:[~2018-05-11  7:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 14:58 [Qemu-devel] [PATCH v3 0/9] qemu-img convert with copy offloading Fam Zheng
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 1/9] block: Introduce API for " Fam Zheng
2018-05-10  8:44   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 2/9] raw: Implement " Fam Zheng
2018-05-09 15:17   ` Eric Blake
2018-05-11  6:19     ` Fam Zheng
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 3/9] qcow2: " Fam Zheng
2018-05-10  9:25   ` Stefan Hajnoczi
2018-05-10 14:51     ` Fam Zheng
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 4/9] file-posix: Implement bdrv_co_copy_range Fam Zheng
2018-05-10  8:50   ` Stefan Hajnoczi
2018-05-11  7:20     ` Fam Zheng [this message]
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 5/9] iscsi: Query and save device designator when opening Fam Zheng
2018-05-10  8:54   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 6/9] iscsi: Create and use iscsi_co_wait_for_task Fam Zheng
2018-05-09 15:19   ` Eric Blake
2018-05-10  8:58   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 7/9] iscsi: Implement copy offloading Fam Zheng
2018-05-10  9:04   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 8/9] block-backend: Add blk_co_copy_range Fam Zheng
2018-05-10  9:05   ` Stefan Hajnoczi
2018-05-09 14:58 ` [Qemu-devel] [PATCH v3 9/9] qemu-img: Convert with copy offloading Fam Zheng
2018-05-10  9:08   ` Stefan Hajnoczi

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=20180511072005.GB28054@lemon.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    --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 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).