peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0023-vitriofsd-passthrough_ll-fix-fallocate-ifdefs.patch

1d442b
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
1d442b
Date: Mon, 27 Jan 2020 19:00:52 +0000
1d442b
Subject: [PATCH] vitriofsd/passthrough_ll: fix fallocate() ifdefs
1d442b
1d442b
1) Use correct CONFIG_FALLOCATE macro to check if fallocate() is supported.(i.e configure
1d442b
   script sets CONFIG_FALLOCATE intead of HAVE_FALLOCATE if fallocate() is supported)
1d442b
2) Replace HAVE_POSIX_FALLOCATE with CONFIG_POSIX_FALLOCATE.
1d442b
1d442b
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
  Merged from two of Xiao Yang's patches
1d442b
(cherry picked from commit 9776457ca6f05d5900e27decb1dba2ffddf95a22)
1d442b
---
1d442b
 tools/virtiofsd/passthrough_ll.c | 4 ++--
1d442b
 1 file changed, 2 insertions(+), 2 deletions(-)
1d442b
1d442b
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
1d442b
index 322a889cdf..6c4da18075 100644
1d442b
--- a/tools/virtiofsd/passthrough_ll.c
1d442b
+++ b/tools/virtiofsd/passthrough_ll.c
1d442b
@@ -975,13 +975,13 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
1d442b
     int err = EOPNOTSUPP;
1d442b
     (void)ino;
1d442b
 
1d442b
-#ifdef HAVE_FALLOCATE
1d442b
+#ifdef CONFIG_FALLOCATE
1d442b
     err = fallocate(fi->fh, mode, offset, length);
1d442b
     if (err < 0) {
1d442b
         err = errno;
1d442b
     }
1d442b
 
1d442b
-#elif defined(HAVE_POSIX_FALLOCATE)
1d442b
+#elif defined(CONFIG_POSIX_FALLOCATE)
1d442b
     if (mode) {
1d442b
         fuse_reply_err(req, EOPNOTSUPP);
1d442b
         return;