selftests/filesystems/mount-notify: remove __kernel_fsid_t
PATCH 1/1 selftests/filesystems/mount-notify: remove __kernel_fsid_t
When build kernel selftests on Ubuntu 24.04, I got a compiler error:
mount-notify_test.c:22:3: error: conflicting types for ‘__kernel_fsid_t’; have ‘struct <anonymous>’
22 | } __kernel_fsid_t;
| ^~~~~~~~~~~~~~~
In file included from .../linux/usr/include/asm/posix_types_64.h:18,
from .../linux/usr/include/asm/posix_types.h:7,
from .../linux/usr/include/linux/posix_types.h:36,
from .../linux/usr/include/linux/types.h:9,
from .../linux/usr/include/linux/stat.h:5,
from /usr/include/x86_64-linux-gnu/bits/statx.h:31,
from /usr/include/x86_64-linux-gnu/sys/stat.h:465,
from mount-notify_test.c:9:
.../linux/usr/include/asm-generic/posix_types.h:81:3: note: previous declaration of ‘__kernel_fsid_t’ with type ‘__kernel_fsid_t’
81 | } __kernel_fsid_t;
| ^~~~~~~~~~~~~~~Signed-off-by Chen Linxuan <[email protected]>
--- .../selftests/filesystems/mount-notify/mount-notify_test.c | 7 ------- .../filesystems/mount-notify/mount-notify_test_ns.c | 7 ------- 2 files changed, 14 deletions(-)
tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c +0 -7
@@ -15,13 +15,6 @@#include "../statmount/statmount.h" #include "../utils.h" -// Needed for linux/fanotify.h -#ifndef __kernel_fsid_t -typedef struct { -int val[2 ]; -}__kernel_fsid_t ; -#endif -#include <sys/fanotify.h> static const char root_mntpoint_templ[] ="/tmp/mount-notify_test_root.XXXXXX" ;
tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c +0 -7
@@ -16,13 +16,6 @@#include "../statmount/statmount.h" #include "../utils.h" -// Needed for linux/fanotify.h -#ifndef __kernel_fsid_t -typedef struct { -int val[2 ]; -}__kernel_fsid_t ; -#endif -#include <sys/fanotify.h> static const char root_mntpoint_templ[] ="/tmp/mount-notify_test_root.XXXXXX" ;
Signature · 1 line
2.43.0
Quoted 17 lines · Chen Linxuan
When build kernel selftests on Ubuntu 24.04, I got a compiler error:
mount-notify_test.c:22:3: error: conflicting types for ‘__kernel_fsid_t’; have ‘struct <anonymous>’
22 | } __kernel_fsid_t; | ^~~~~~~~~~~~~~~ In file included from .../linux/usr/include/asm/posix_types_64.h:18, from .../linux/usr/include/asm/posix_types.h:7, from .../linux/usr/include/linux/posix_types.h:36, from .../linux/usr/include/linux/types.h:9, from .../linux/usr/include/linux/stat.h:5, from /usr/include/x86_64-linux-gnu/bits/statx.h:31, from /usr/include/x86_64-linux-gnu/sys/stat.h:465, from mount-notify_test.c:9: .../linux/usr/include/asm-generic/posix_types.h:81:3: note: previous declaration of ‘__kernel_fsid_t’ with type ‘__kernel_fsid_t’ 81 | } __kernel_fsid_t; | ^~~~~~~~~~~~~~~
Quoted 1 line
Signed-off-by Chen Linxuan <[email protected]>
Reviewed-by Muhammad Usama Anjum <[email protected]>
Tested-by Muhammad Usama Anjum <[email protected]>
Quoted 41 lines
--- .../selftests/filesystems/mount-notify/mount-notify_test.c | 7 ------- .../filesystems/mount-notify/mount-notify_test_ns.c | 7 ------- 2 files changed, 14 deletions(-)tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c +0
-7@@ -15,13 +15,6 @@#include "../statmount/statmount.h" #include "../utils.h" -// Needed for linux/fanotify.h -#ifndef __kernel_fsid_t -typedef struct { -int val[2 ]; -}__kernel_fsid_t ; -#endif -#include <sys/fanotify.h> static const char root_mntpoint_templ[] ="/tmp/mount-notify_test_root.XXXXXX" ;tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c +0
-7@@ -16,13 +16,6 @@#include "../statmount/statmount.h" #include "../utils.h" -// Needed for linux/fanotify.h -#ifndef __kernel_fsid_t -typedef struct { -int val[2 ]; -}__kernel_fsid_t ; -#endif -#include <sys/fanotify.h> static const char root_mntpoint_templ[] ="/tmp/mount-notify_test_root.XXXXXX" ;