summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/extent-scan.c4
-rw-r--r--src/fiemap.h8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/extent-scan.c b/src/extent-scan.c
index 48dd564e5..37445b84d 100644
--- a/src/extent-scan.c
+++ b/src/extent-scan.c
@@ -24,11 +24,9 @@
#include "system.h"
#include "extent-scan.h"
+#include "fiemap.h"
#include "xstrtol.h"
-#ifndef HAVE_FIEMAP
-# include "fiemap.h"
-#endif
/* Work around Linux kernel issues on BTRFS and EXT4 before 2.6.39.
FIXME: remove in 2013, or whenever we're pretty confident
diff --git a/src/fiemap.h b/src/fiemap.h
index e7243b41b..15ddff9a0 100644
--- a/src/fiemap.h
+++ b/src/fiemap.h
@@ -52,8 +52,12 @@ struct fiemap
uint32_t fm_reserved;
/* Array of mapped extents(out).
- The actual size is given by fm_extent_count. */
- struct fiemap_extent fm_extents[1];
+ This is protected by the ifdef because it uses non standard
+ zero length arrays. Note C99 has the equivalent flexible arrays,
+ but we don't use those for maximum portability to older systems. */
+# ifdef __linux__
+ struct fiemap_extent fm_extents[0];
+# endif
};
/* The maximum offset can be mapped for a file. */