diff options
author | Amir Goldstein <amir73il@gmail.com> | 2020-07-16 11:42:28 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2020-07-27 23:24:00 +0200 |
commit | 929943b38daf817f2e6d303ea04401651fc3bc05 (patch) | |
tree | 09457340373aacd99fb77e114d19e38e0c60e9e7 /include/uapi/linux/fanotify.h | |
parent | 5128063739d293b9faf8ffaa9a5dfd622bc954f5 (diff) | |
download | linux-929943b38daf817f2e6d303ea04401651fc3bc05.tar.gz linux-929943b38daf817f2e6d303ea04401651fc3bc05.tar.bz2 linux-929943b38daf817f2e6d303ea04401651fc3bc05.zip |
fanotify: add support for FAN_REPORT_NAME
Introduce a new fanotify_init() flag FAN_REPORT_NAME. It requires the
flag FAN_REPORT_DIR_FID and there is a constant for setting both flags
named FAN_REPORT_DFID_NAME.
For a group with flag FAN_REPORT_NAME, the parent fid and name are
reported for directory entry modification events (create/detete/move)
and for events on non-directory objects.
Events on directories themselves are reported with their own fid and
"." as the name.
The parent fid and name are reported with an info record of type
FAN_EVENT_INFO_TYPE_DFID_NAME, similar to the way that parent fid is
reported with into type FAN_EVENT_INFO_TYPE_DFID, but with an appended
null terminated name string.
Link: https://lore.kernel.org/r/20200716084230.30611-21-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/uapi/linux/fanotify.h')
-rw-r--r-- | include/uapi/linux/fanotify.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h index 21afebf77fd7..fbf9c5c7dd59 100644 --- a/include/uapi/linux/fanotify.h +++ b/include/uapi/linux/fanotify.h @@ -54,6 +54,10 @@ #define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */ #define FAN_REPORT_FID 0x00000200 /* Report unique file id */ #define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */ +#define FAN_REPORT_NAME 0x00000800 /* Report events with name */ + +/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */ +#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME) /* Deprecated - do not use this in programs and do not add new flags here! */ #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ |