public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] src/t_stripealign.c: Fix complier error
@ 2018-06-20  3:12 Xiao Yang
  2018-06-20  3:30 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Yang @ 2018-06-20  3:12 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, Xiao Yang

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@cn.fujitsu.com>
---
 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




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] src/t_stripealign.c: Fix complier error
  2018-06-20  3:12 [PATCH] src/t_stripealign.c: Fix complier error Xiao Yang
@ 2018-06-20  3:30 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2018-06-20  3:30 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests

On Wed, Jun 20, 2018 at 11:12:00AM +0800, Xiao Yang wrote:
> 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@cn.fujitsu.com>

Oops, yeah, sorry about that.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  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
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-20  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20  3:12 [PATCH] src/t_stripealign.c: Fix complier error Xiao Yang
2018-06-20  3:30 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox