thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-vitriofsd-passthrough_ll-fix-fallocate-ifdefs.patch

ddf19c
From 247987aa987b7332eb501e00c440079b9e8e1fe7 Mon Sep 17 00:00:00 2001
ddf19c
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ddf19c
Date: Mon, 27 Jan 2020 19:00:52 +0100
ddf19c
Subject: [PATCH 021/116] vitriofsd/passthrough_ll: fix fallocate() ifdefs
ddf19c
MIME-Version: 1.0
ddf19c
Content-Type: text/plain; charset=UTF-8
ddf19c
Content-Transfer-Encoding: 8bit
ddf19c
ddf19c
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
Message-id: <20200127190227.40942-18-dgilbert@redhat.com>
ddf19c
Patchwork-id: 93471
ddf19c
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 017/112] vitriofsd/passthrough_ll: fix fallocate() ifdefs
ddf19c
Bugzilla: 1694164
ddf19c
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
ddf19c
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ddf19c
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
ddf19c
ddf19c
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
ddf19c
ddf19c
1) Use correct CONFIG_FALLOCATE macro to check if fallocate() is supported.(i.e configure
ddf19c
   script sets CONFIG_FALLOCATE intead of HAVE_FALLOCATE if fallocate() is supported)
ddf19c
2) Replace HAVE_POSIX_FALLOCATE with CONFIG_POSIX_FALLOCATE.
ddf19c
ddf19c
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
ddf19c
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
  Merged from two of Xiao Yang's patches
ddf19c
(cherry picked from commit 9776457ca6f05d5900e27decb1dba2ffddf95a22)
ddf19c
ddf19c
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ddf19c
---
ddf19c
 tools/virtiofsd/passthrough_ll.c | 4 ++--
ddf19c
 1 file changed, 2 insertions(+), 2 deletions(-)
ddf19c
ddf19c
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
ddf19c
index 322a889..6c4da18 100644
ddf19c
--- a/tools/virtiofsd/passthrough_ll.c
ddf19c
+++ b/tools/virtiofsd/passthrough_ll.c
ddf19c
@@ -975,13 +975,13 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
ddf19c
     int err = EOPNOTSUPP;
ddf19c
     (void)ino;
ddf19c
 
ddf19c
-#ifdef HAVE_FALLOCATE
ddf19c
+#ifdef CONFIG_FALLOCATE
ddf19c
     err = fallocate(fi->fh, mode, offset, length);
ddf19c
     if (err < 0) {
ddf19c
         err = errno;
ddf19c
     }
ddf19c
 
ddf19c
-#elif defined(HAVE_POSIX_FALLOCATE)
ddf19c
+#elif defined(CONFIG_POSIX_FALLOCATE)
ddf19c
     if (mode) {
ddf19c
         fuse_reply_err(req, EOPNOTSUPP);
ddf19c
         return;
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c