Pull fanotify updates from Jan Kara: "Support for new FAN_RENAME fanotify event and support for reporting child info in directory fanotify events (FAN_REPORT_TARGET_FID)" * tag 'fsnotify_for_v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: wire up FAN_RENAME event fanotify: report old and/or new parent+name in FAN_RENAME event fanotify: record either old name new name or both for FAN_RENAME fanotify: record old and new parent and name in FAN_RENAME event fanotify: support secondary dir fh and name in fanotify_info fanotify: use helpers to parcel fanotify_info buffer fanotify: use macros to get the offset to fanotify_info buffer fsnotify: generate FS_RENAME event with rich information fanotify: introduce group flag FAN_REPORT_TARGET_FID fsnotify: separate mark iterator type from object type enum fsnotify: clarify object type argument
Showing the changes to include/uapi/linux (1 of 12 files). Show all
Unified · Split
| @@ -28,6 +28,8 @@ · 27 unmodified lines | |||
| 28 | 28 | ||
| 29 | #define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */ | 29 | #define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */ |
| 30 | 30 | ||
| 31 | #define FAN_RENAME 0x10000000 /* File was renamed */ | ||
| 32 | |||
| 31 | #define FAN_ONDIR 0x40000000 /* Event occurred against dir */ | 33 | #define FAN_ONDIR 0x40000000 /* Event occurred against dir */ |
| 32 | 34 | ||
| 33 | /* helper events */ | 35 | /* helper events */ |
| @@ -57,9 +59,13 @@ · 23 unmodified lines | |||
| 57 | #define FAN_REPORT_FID 0x00000200 /* Report unique file id */ | 59 | #define FAN_REPORT_FID 0x00000200 /* Report unique file id */ |
| 58 | #define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */ | 60 | #define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */ |
| 59 | #define FAN_REPORT_NAME 0x00000800 /* Report events with name */ | 61 | #define FAN_REPORT_NAME 0x00000800 /* Report events with name */ |
| 62 | #define FAN_REPORT_TARGET_FID 0x00001000 /* Report dirent target id */ | ||
| 60 | 63 | ||
| 61 | /* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */ | 64 | /* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */ |
| 62 | #define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME) | 65 | #define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME) |
| 66 | /* Convenience macro - FAN_REPORT_TARGET_FID requires all other FID flags */ | ||
| 67 | #define FAN_REPORT_DFID_NAME_TARGET (FAN_REPORT_DFID_NAME | \ | ||
| 68 | FAN_REPORT_FID | FAN_REPORT_TARGET_FID) | ||
| 63 | 69 | ||
| 64 | /* Deprecated - do not use this in programs and do not add new flags here! */ | 70 | /* Deprecated - do not use this in programs and do not add new flags here! */ |
| 65 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ | 71 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ |
| @@ -128,6 +134,12 @@ struct fanotify_event_metadata { · 62 unmodified lines | |||
| 128 | #define FAN_EVENT_INFO_TYPE_PIDFD 4 | 134 | #define FAN_EVENT_INFO_TYPE_PIDFD 4 |
| 129 | #define FAN_EVENT_INFO_TYPE_ERROR 5 | 135 | #define FAN_EVENT_INFO_TYPE_ERROR 5 |
| 130 | 136 | ||
| 137 | /* Special info types for FAN_RENAME */ | ||
| 138 | #define FAN_EVENT_INFO_TYPE_OLD_DFID_NAME 10 | ||
| 139 | /* Reserved for FAN_EVENT_INFO_TYPE_OLD_DFID 11 */ | ||
| 140 | #define FAN_EVENT_INFO_TYPE_NEW_DFID_NAME 12 | ||
| 141 | /* Reserved for FAN_EVENT_INFO_TYPE_NEW_DFID 13 */ | ||
| 142 | |||
| 131 | /* Variable length info record following event metadata */ | 143 | /* Variable length info record following event metadata */ |
| 132 | struct fanotify_event_info_header { | 144 | struct fanotify_event_info_header { |
| 133 | __u8 info_type; | 145 | __u8 info_type; |