[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 066/104] virtiofsd: passthrough_ll: add renameat2 support
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 066/104] virtiofsd: passthrough_ll: add renameat2 support |
Date: |
Tue, 7 Jan 2020 11:21:43 +0000 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Thu, Dec 12, 2019 at 04:38:26PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: Miklos Szeredi <address@hidden>
>
> No glibc support yet, so use syscall().
It exists in glibc in my Fedora 31 install.
Presumably this is related to an older version
> Signed-off-by: Miklos Szeredi <address@hidden>
> ---
> tools/virtiofsd/passthrough_ll.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/tools/virtiofsd/passthrough_ll.c
> b/tools/virtiofsd/passthrough_ll.c
> index 91d3120033..bed2270141 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -1083,7 +1083,17 @@ static void lo_rename(fuse_req_t req, fuse_ino_t
> parent, const char *name,
> }
>
> if (flags) {
> +#ifndef SYS_renameat2
> fuse_reply_err(req, EINVAL);
> +#else
> + res = syscall(SYS_renameat2, lo_fd(req, parent), name,
> + lo_fd(req, newparent), newname, flags);
> + if (res == -1 && errno == ENOSYS) {
> + fuse_reply_err(req, EINVAL);
> + } else {
> + fuse_reply_err(req, res == -1 ? errno : 0);
> + }
> +#endif
We should use the formal API if available as first choice
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- Re: [PATCH 066/104] virtiofsd: passthrough_ll: add renameat2 support,
Daniel P . Berrangé <=