vitriofsd/passthrough_ll: fix fallocate() ifdefs
authorXiao Yang <yangx.jy@cn.fujitsu.com>
Mon, 13 Jan 2020 09:37:34 +0000 (17:37 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 23 Jan 2020 16:41:36 +0000 (16:41 +0000)
1) Use correct CONFIG_FALLOCATE macro to check if fallocate() is supported.(i.e configure
   script sets CONFIG_FALLOCATE intead of HAVE_FALLOCATE if fallocate() is supported)
2) Replace HAVE_POSIX_FALLOCATE with CONFIG_POSIX_FALLOCATE.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Merged from two of Xiao Yang's patches

tools/virtiofsd/passthrough_ll.c

index 322a889cdfae9800affc3a80a082bbbdf583fcea..6c4da1807513ce9398bc1164f5af480dfbd7a45e 100644 (file)
@@ -975,13 +975,13 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
     int err = EOPNOTSUPP;
     (void)ino;
 
-#ifdef HAVE_FALLOCATE
+#ifdef CONFIG_FALLOCATE
     err = fallocate(fi->fh, mode, offset, length);
     if (err < 0) {
         err = errno;
     }
 
-#elif defined(HAVE_POSIX_FALLOCATE)
+#elif defined(CONFIG_POSIX_FALLOCATE)
     if (mode) {
         fuse_reply_err(req, EOPNOTSUPP);
         return;