[Virtio-fs] [PATCH 2/2] virtiofsd/passthrough_ll: Only call posix_fallocate() when it is supported
Xiao Yang
yangx.jy at cn.fujitsu.com
Mon Jan 13 09:37:35 UTC 2020
passthrough_ll sets HAVE_POSIX_FALLOCATE macro compulsively so posix_fallocate()
is always called even if it is not supported. Replace HAVE_POSIX_FALLOCATE with
CONFIG_POSIX_FALLOCATE.
Signed-off-by: Xiao Yang <yangx.jy at cn.fujitsu.com>
---
tools/virtiofsd/passthrough_ll.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index a19823caaf..196664d52b 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -72,8 +72,6 @@
#include "passthrough_helpers.h"
#include "seccomp.h"
-#define HAVE_POSIX_FALLOCATE 1
-
/* Keep track of inode posix locks for each owner. */
struct lo_inode_plock {
uint64_t lock_owner;
@@ -2319,7 +2317,7 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
err = errno;
}
-#elif defined(HAVE_POSIX_FALLOCATE)
+#elif defined(CONFIG_POSIX_FALLOCATE)
if (mode) {
fuse_reply_err(req, EOPNOTSUPP);
return;
--
2.21.0
More information about the Virtio-fs
mailing list