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.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -54,6 +54,10 @@ · 53 unmodified lines | |||
| 54 | #define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */ | 54 | #define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */ |
| 55 | #define FAN_REPORT_FID 0x00000200 /* Report unique file id */ | 55 | #define FAN_REPORT_FID 0x00000200 /* Report unique file id */ |
| 56 | #define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */ | 56 | #define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */ |
| 57 | #define FAN_REPORT_NAME 0x00000800 /* Report events with name */ | ||
| 58 | |||
| 59 | /* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */ | ||
| 60 | #define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME) | ||
| 57 | 61 | ||
| 58 | /* Deprecated - do not use this in programs and do not add new flags here! */ | 62 | /* Deprecated - do not use this in programs and do not add new flags here! */ |
| 59 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ | 63 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ |