aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough_fh.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/passthrough_fh.c')
-rw-r--r--example/passthrough_fh.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/example/passthrough_fh.c b/example/passthrough_fh.c
index 7bbdb70..6764554 100644
--- a/example/passthrough_fh.c
+++ b/example/passthrough_fh.c
@@ -47,6 +47,8 @@
#endif
#include <sys/file.h> /* flock(2) */
+#include "passthrough_helpers.h"
+
static void *xmp_init(struct fuse_conn_info *conn,
struct fuse_config *cfg)
{
@@ -514,18 +516,13 @@ static int xmp_fsync(const char *path, int isdatasync,
return 0;
}
-#ifdef HAVE_POSIX_FALLOCATE
static int xmp_fallocate(const char *path, int mode,
off_t offset, off_t length, struct fuse_file_info *fi)
{
(void) path;
- if (mode)
- return -EOPNOTSUPP;
-
- return -posix_fallocate(fi->fh, offset, length);
+ return do_fallocate(fi->fh, mode, offset, length);
}
-#endif
#ifdef HAVE_SETXATTR
/* xattr operations are optional and can safely be left unimplemented */
@@ -650,9 +647,7 @@ static const struct fuse_operations xmp_oper = {
.flush = xmp_flush,
.release = xmp_release,
.fsync = xmp_fsync,
-#ifdef HAVE_POSIX_FALLOCATE
.fallocate = xmp_fallocate,
-#endif
#ifdef HAVE_SETXATTR
.setxattr = xmp_setxattr,
.getxattr = xmp_getxattr,