Skip to content

Commit

Permalink
vitriofsd/passthrough_ll: fix fallocate() ifdefs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yangx-jy authored and dagrh committed Jan 23, 2020
1 parent 72c42e2 commit 9776457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/virtiofsd/passthrough_ll.c
Expand Up @@ -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;
Expand Down

0 comments on commit 9776457

Please sign in to comment.