From 689b86cfe6c9258c8507c8391ed62aa1a640c1e3 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 20 Nov 2013 13:41:49 -0500 Subject: libglusterfs: use correct check for linux falloc.h availability We should check for HAVE_LINUX_FALLOC_H rather than HAVE_FALLOC_H to determine whether to include linux/falloc.h. Change-Id: I05eca4de2893a88d6b9cc5ebfce738708b9960d4 BUG: 1032378 Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.org/6314 Reviewed-by: Anand Avati Tested-by: Anand Avati --- libglusterfs/src/compat.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h index 2bd982541..359a4a3b5 100644 --- a/libglusterfs/src/compat.h +++ b/libglusterfs/src/compat.h @@ -32,10 +32,19 @@ #include #include #include -#ifdef HAVE_FALLOC_H +#ifdef HAVE_LINUX_FALLOC_H #include -#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 -- cgit