summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/compat.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h
index 2bd9825417b..359a4a3b5cf 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -32,10 +32,19 @@
#include <linux/limits.h>
#include <sys/xattr.h>
#include <endian.h>
-#ifdef HAVE_FALLOC_H
+#ifdef HAVE_LINUX_FALLOC_H
#include <linux/falloc.h>
-#else
+#endif
+
+/*
+ * Define the fallocate flags in case we do not have the header. This also
+ * accounts for older systems that do not define FALLOC_FL_PUNCH_HOLE.
+ */
+
+#ifndef FALLOC_FL_KEEP_SIZE
#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
+#endif
+#ifndef FALLOC_FL_PUNCH_HOLE
#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
#endif