summaryrefslogtreecommitdiffstats
path: root/sys-utils/fallocate.c
diff options
context:
space:
mode:
authorKarel Zak2011-11-23 15:19:20 +0100
committerKarel Zak2011-11-23 15:19:20 +0100
commitf75b8e5cdfa40b81a0b631b02491a99115409371 (patch)
tree2f0aa684514e8cf42ea37d2cdd25f8f46615feaf /sys-utils/fallocate.c
parenttests: add mkfs.carmfs test for small FS with duplicate files (diff)
downloadkernel-qcow2-util-linux-f75b8e5cdfa40b81a0b631b02491a99115409371.tar.gz
kernel-qcow2-util-linux-f75b8e5cdfa40b81a0b631b02491a99115409371.tar.xz
kernel-qcow2-util-linux-f75b8e5cdfa40b81a0b631b02491a99115409371.zip
fallocate: clean up fallbacks for FALLOC_FL_* flags
Reported-by: Voelker, Bernhard <bernhard.voelker@siemens-enterprise.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/fallocate.c')
-rw-r--r--sys-utils/fallocate.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index b58485a78..ef19a770b 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -38,8 +38,13 @@
#ifdef HAVE_LINUX_FALLOC_H
# include <linux/falloc.h> /* for FALLOC_FL_* flags */
-#else
+#endif
+
+#ifndef FALLOC_FL_KEEP_SIZE
# define FALLOC_FL_KEEP_SIZE 1
+#endif
+
+#ifndef FALLOC_FL_PUNCH_HOLE
# define FALLOC_FL_PUNCH_HOLE 2
#endif