summaryrefslogtreecommitdiffstats
path: root/tools/virtiofsd/passthrough_ll.c
diff options
context:
space:
mode:
authorMiklos Szeredi2018-08-15 17:05:29 +0200
committerDr. David Alan Gilbert2020-01-23 17:41:37 +0100
commitf0ab7d6f78a7d3c1c19fd81a91c9b1199f56c4f6 (patch)
treefb063cd10ee7854c1975ca68883edc2e8d989e92 /tools/virtiofsd/passthrough_ll.c
parentcontrib/libvhost-user: Protect slave fd with mutex (diff)
downloadqemu-f0ab7d6f78a7d3c1c19fd81a91c9b1199f56c4f6.tar.gz
qemu-f0ab7d6f78a7d3c1c19fd81a91c9b1199f56c4f6.tar.xz
qemu-f0ab7d6f78a7d3c1c19fd81a91c9b1199f56c4f6.zip
virtiofsd: passthrough_ll: add renameat2 support
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd/passthrough_ll.c')
-rw-r--r--tools/virtiofsd/passthrough_ll.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 98114a3f4a..18d69abcbc 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -1099,7 +1099,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
return;
}