[LTP] [PATCH 2/3] fsstress/global.h: Include lapi/fcntl.h

Petr Vorel pvorel@suse.cz
Wed Jun 28 10:28:26 CEST 2023


> To avoid potential problems with different O_DIRECT values across archs.

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/kernel/fs/fsstress/global.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/testcases/kernel/fs/fsstress/global.h b/testcases/kernel/fs/fsstress/global.h
> index 4ec382426..863fff263 100644
> --- a/testcases/kernel/fs/fsstress/global.h
> +++ b/testcases/kernel/fs/fsstress/global.h
> @@ -50,7 +50,6 @@
>  #include <sys/ioctl.h>
>  #include <sys/wait.h>
>  #include <sys/types.h>
> -#include <fcntl.h>
>  #include <stdlib.h>
>  #include <dirent.h>
>  #include <errno.h>
> @@ -58,6 +57,7 @@
>  #include <stdlib.h>
>  #include <stdio.h>
>  #include <unistd.h>
> +#include "lapi/fcntl.h"

>  #ifndef O_DIRECT
>  #define O_DIRECT 040000

I forget to amend. This fallback definition should have been removed.
But maybe we should put _GNU_SOURCE definition into the header.

Kind regards,
Petr

+++ testcases/kernel/fs/fsstress/global.h
@@ -59,8 +59,4 @@
 #include <unistd.h>
 #include "lapi/fcntl.h"
 
-#ifndef O_DIRECT
-#define O_DIRECT 040000
-#endif
-
 #endif


More information about the ltp mailing list