[PATCH] src/t_stripealign.c: Fix complier error

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



The FIEMAP_EXTENT_SHARED flag was added into kernel since commit
8c0414cd524e, so undefined FIEMAP_EXTENT_SHARED resulted in complier
error on old distros(e.g. RHEL6), as below:
----------------------------------------------------------------------
t_stripealign.c:99: error: 'FIEMAP_EXTENT_SHARED' undeclared (first use in this function)
----------------------------------------------------------------------

We fix it by defining the flag manually.

Signed-off-by: Xiao Yang <yangx.jy@xxxxxxxxxxxxxx>
---
 src/t_stripealign.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/t_stripealign.c b/src/t_stripealign.c
index 690f743..2685d97 100644
--- a/src/t_stripealign.c
+++ b/src/t_stripealign.c
@@ -20,6 +20,10 @@
 #include <linux/fiemap.h>
 #include <linux/fs.h>
 
+#ifndef FIEMAP_EXTENT_SHARED
+# define FIEMAP_EXTENT_SHARED	0x00002000
+#endif
+
 #define FIEMAP_EXTENT_ACCEPTABLE	(FIEMAP_EXTENT_LAST | \
 		FIEMAP_EXTENT_DATA_ENCRYPTED | FIEMAP_EXTENT_ENCODED | \
 		FIEMAP_EXTENT_UNWRITTEN | FIEMAP_EXTENT_MERGED | \
-- 
1.7.1



--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux