diff options
| author | Amir Goldstein <[email protected]> | 2025-05-09 13:32:37 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2025-05-12 09:40:12 +0000 |
| commit | c6d9775c2066a37385e784ee2e0ce83bd6644610 (patch) | |
| tree | fa458d2790ff8d2511cbd2cfbe2f603034bc7464 /tools/testing/selftests/filesystems | |
| parent | selftests/mount_settattr: remove duplicate syscall definitions (diff) | |
| download | kernel-c6d9775c2066a37385e784ee2e0ce83bd6644610.tar.gz kernel-c6d9775c2066a37385e784ee2e0ce83bd6644610.zip | |
selftests/fs/mount-notify: build with tools include dir
Copy the fanotify uapi header files to the tools include dir
and define __kernel_fsid_t to decouple dependency with headers_install
and then remove the redundant re-definitions of fanotify macros.
Reviewed-by: John Hubbard <[email protected]>
Signed-off-by: Amir Goldstein <[email protected]>
Link: https://lore.kernel.org/[email protected]
Reviewed-by: Christian Brauner <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'tools/testing/selftests/filesystems')
| -rw-r--r-- | tools/testing/selftests/filesystems/mount-notify/Makefile | 3 | ||||
| -rw-r--r-- | tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c | 25 |
2 files changed, 8 insertions, 20 deletions
diff --git a/tools/testing/selftests/filesystems/mount-notify/Makefile b/tools/testing/selftests/filesystems/mount-notify/Makefile index 10be0227b5ae..41ebfe558a0a 100644 --- a/tools/testing/selftests/filesystems/mount-notify/Makefile +++ b/tools/testing/selftests/filesystems/mount-notify/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later -CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES) +CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES) $(TOOLS_INCLUDES) + TEST_GEN_PROGS := mount-notify_test include ../../lib.mk diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c index 59a71f22fb11..4f0f325379b5 100644 --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c @@ -8,33 +8,20 @@ #include <string.h> #include <sys/stat.h> #include <sys/mount.h> -#include <linux/fanotify.h> #include <unistd.h> -#include <sys/fanotify.h> #include <sys/syscall.h> #include "../../kselftest_harness.h" #include "../statmount/statmount.h" -#ifndef FAN_MNT_ATTACH -struct fanotify_event_info_mnt { - struct fanotify_event_info_header hdr; - __u64 mnt_id; -}; -#define FAN_MNT_ATTACH 0x01000000 /* Mount was attached */ -#endif - -#ifndef FAN_MNT_DETACH -#define FAN_MNT_DETACH 0x02000000 /* Mount was detached */ +// Needed for linux/fanotify.h +#ifndef __kernel_fsid_t +typedef struct { + int val[2]; +} __kernel_fsid_t; #endif -#ifndef FAN_REPORT_MNT -#define FAN_REPORT_MNT 0x00004000 /* Report mount events */ -#endif - -#ifndef FAN_MARK_MNTNS -#define FAN_MARK_MNTNS 0x00000110 -#endif +#include <sys/fanotify.h> static uint64_t get_mnt_id(struct __test_metadata *const _metadata, const char *path) |
