From: Dmitry V. Levin Date: Fri, 9 Jan 2015 02:18:03 +0000 (+0000) Subject: Cleanup local copy of linux/fanotify.h X-Git-Tag: v4.10~241 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75d62047ad2abf5c2509567aeb9c241c04acbfe6;p=strace Cleanup local copy of linux/fanotify.h * linux/fanotify.h: Remove macros and structures not used by fanotify_init and fanotify_mark parsers. --- diff --git a/linux/fanotify.h b/linux/fanotify.h index f780e5ae..9934e08d 100644 --- a/linux/fanotify.h +++ b/linux/fanotify.h @@ -1,8 +1,6 @@ #ifndef _LINUX_FANOTIFY_H #define _LINUX_FANOTIFY_H -#include - /* the following events that user-space can register for */ #define FAN_ACCESS 0x00000001 /* File was accessed */ #define FAN_MODIFY 0x00000002 /* File was modified */ @@ -50,67 +48,7 @@ #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 #define FAN_MARK_FLUSH 0x00000080 -#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ - FAN_MARK_REMOVE |\ - FAN_MARK_DONT_FOLLOW |\ - FAN_MARK_ONLYDIR |\ - FAN_MARK_MOUNT |\ - FAN_MARK_IGNORED_MASK |\ - FAN_MARK_IGNORED_SURV_MODIFY |\ - FAN_MARK_FLUSH) - -/* - * All of the events - we build the list by hand so that we can add flags in - * the future and not break backward compatibility. Apps will get only the - * events that they originally wanted. Be sure to add new events here! - */ -#define FAN_ALL_EVENTS (FAN_ACCESS |\ - FAN_MODIFY |\ - FAN_CLOSE |\ - FAN_OPEN) - -/* - * All events which require a permission response from userspace - */ -#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\ - FAN_ACCESS_PERM) - -#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\ - FAN_ALL_PERM_EVENTS |\ - FAN_Q_OVERFLOW) - -#define FANOTIFY_METADATA_VERSION 3 - -struct fanotify_event_metadata { - __u32 event_len; - __u8 vers; - __u8 reserved; - __u16 metadata_len; - __aligned_u64 mask; - __s32 fd; - __s32 pid; -}; - -struct fanotify_response { - __s32 fd; - __u32 response; -}; - -/* Legit userspace responses to a _PERM event */ -#define FAN_ALLOW 0x01 -#define FAN_DENY 0x02 /* No fd set in event */ #define FAN_NOFD -1 -/* Helper functions to deal with fanotify_event_metadata buffers */ -#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata)) - -#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \ - (struct fanotify_event_metadata*)(((char *)(meta)) + \ - (meta)->event_len)) - -#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \ - (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \ - (long)(meta)->event_len <= (long)(len)) - #endif /* _LINUX_FANOTIFY_H */