qemu-devel
[Top][All Lists]
Advanced

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

[PULL 069/111] virtiofsd: passthrough_ll: add renameat2 support


From: Dr. David Alan Gilbert (git)
Subject: [PULL 069/111] virtiofsd: passthrough_ll: add renameat2 support
Date: Thu, 23 Jan 2020 11:57:59 +0000

From: Miklos Szeredi <address@hidden>

Signed-off-by: Miklos Szeredi <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <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 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;
     }
 
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]