[LTP] [PATCH v2 5/7] fanotify: Drop unused feature test macros

Jan Kara jack@suse.cz
Thu Nov 30 10:37:08 CET 2023


Drop now unused feature test macros
fanotify_events_supported_by_kernel() and
fanotify_mark_supported_by_kernel().

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 testcases/kernel/syscalls/fanotify/fanotify.h | 44 -------------------
 1 file changed, 44 deletions(-)

diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
index 1c30a0bcab2a..d49966810381 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify.h
+++ b/testcases/kernel/syscalls/fanotify/fanotify.h
@@ -152,29 +152,6 @@ static inline void require_fanotify_access_permissions_supported_by_kernel(void)
 	SAFE_CLOSE(fd);
 }
 
-static inline int fanotify_events_supported_by_kernel(uint64_t mask,
-						      unsigned int init_flags,
-						      unsigned int mark_flags)
-{
-	int fd;
-	int rval = 0;
-
-	fd = SAFE_FANOTIFY_INIT(init_flags, O_RDONLY);
-
-	if (fanotify_mark(fd, FAN_MARK_ADD | mark_flags, mask, AT_FDCWD, ".") < 0) {
-		if (errno == EINVAL) {
-			rval = -1;
-		} else {
-			tst_brk(TBROK | TERRNO,
-				"fanotify_mark (%d, FAN_MARK_ADD, ..., AT_FDCWD, \".\") failed", fd);
-		}
-	}
-
-	SAFE_CLOSE(fd);
-
-	return rval;
-}
-
 /*
  * @return  0: fanotify flags supported both in kernel and on tested filesystem
  * @return -1: @init_flags not supported in kernel
@@ -307,27 +284,6 @@ static inline void fanotify_flags_err_msg(const char *flags_str,
 	fanotify_flags_err_msg(#flags, __FILE__, __LINE__, tst_brk_, \
 		fanotify_init_flags_supported_by_kernel(flags))
 
-static inline int fanotify_mark_supported_by_kernel(uint64_t flag)
-{
-	int fd;
-	int rval = 0;
-
-	fd = SAFE_FANOTIFY_INIT(FAN_CLASS_CONTENT, O_RDONLY);
-
-	if (fanotify_mark(fd, FAN_MARK_ADD | flag, FAN_ACCESS, AT_FDCWD, ".") < 0) {
-		if (errno == EINVAL) {
-			rval = -1;
-		} else {
-			tst_brk(TBROK | TERRNO,
-				"fanotify_mark (%d, FAN_MARK_ADD, ..., FAN_ACCESS, AT_FDCWD, \".\") failed", fd);
-		}
-	}
-
-	SAFE_CLOSE(fd);
-
-	return rval;
-}
-
 static inline int fanotify_handle_supported_by_kernel(int flag)
 {
 	/*
-- 
2.35.3



More information about the ltp mailing list