diff mbox series

[4/6] fanotify: Drop unused feature test macros

Message ID 20231129115440.19100-4-jack@suse.cz
State Changes Requested
Headers show
Series fanotify: Make feature tests operate against tested path | expand

Commit Message

Jan Kara Nov. 29, 2023, 11:54 a.m. UTC
Drop now unused feature test macros
fanotify_events_supported_by_kernel() and
fanotify_mark_supported_by_kernel().

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

Comments

Amir Goldstein Nov. 29, 2023, 2:52 p.m. UTC | #1
On Wed, Nov 29, 2023 at 1:54 PM Jan Kara <jack@suse.cz> wrote:
>
> Drop now unused feature test macros
> fanotify_events_supported_by_kernel() and
> fanotify_mark_supported_by_kernel().
>
> Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>


> ---
>  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 31afc29c8cb6..e02ea8c24dcb 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
> @@ -304,27 +281,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
>
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
index 31afc29c8cb6..e02ea8c24dcb 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
@@ -304,27 +281,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)
 {
 	/*