History

Merge tag 'fsnotify_for_v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull fsnotify updates from Jan Kara: - fanotify fix for softlockups when there are many queued events - performance improvement to reduce fsnotify overhead when not used - Amir's implementation of fanotify events with names. With these you can now efficiently monitor whole filesystem, eg to mirror changes to another machine. * tag 'fsnotify_for_v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: (37 commits) fanotify: compare fsid when merging name event fsnotify: create method handle_inode_event() in fsnotify_operations fanotify: report parent fid + child fid fanotify: report parent fid + name + child fid fanotify: add support for FAN_REPORT_NAME fanotify: report events with parent dir fid to sb/mount/non-dir marks fanotify: add basic support for FAN_REPORT_DIR_FID fsnotify: remove check that source dentry is positive fsnotify: send event with parent/name info to sb/mount/non-dir marks audit: do not set FS_EVENT_ON_CHILD in audit marks mask inotify: do not set FS_EVENT_ON_CHILD in non-dir mark mask fsnotify: pass dir and inode arguments to fsnotify() fsnotify: create helper fsnotify_inode() fsnotify: send event to parent and child with single callback inotify: report both events on parent and child with single callback dnotify: report both events on parent and child with single callback fanotify: no external fh buffer in fanotify_name_event fanotify: use struct fanotify_info to parcel the variable size buffer fsnotify: add object type "child" to object type iterator fanotify: use FAN_EVENT_ON_CHILD as implicit flag on sb/mount/non-dir marks ...

Linus Torvalds committed 6 years ago

Commit eb654052 parents 09e70bb 8aed8ce18 files · +966 −424Browse files

Showing the changes to include/uapi/linux (1 of 18 files). Show all

Unified · Split

include/uapi/linux/fanotify.h+11−5
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
2525 #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
2626 #define FAN_OPEN_EXEC_PERM 0x00040000 /* File open/exec in perm check */
27−#define FAN_DIR_MODIFY 0x00080000 /* Directory entry was modified */
2827
2928 #define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */
3029
@@ -54,6 +53,11 @@ · 23 unmodified lines
5453 /* Flags to determine fanotify event format */
5554 #define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */
5655 #define FAN_REPORT_FID 0x00000200 /* Report unique file 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)
5761
5862 /* Deprecated - do not use this in programs and do not add new flags here! */
5963 #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
@@ -118,6 +122,7 @@ struct fanotify_event_metadata { · 58 unmodified lines
118122
119123 #define FAN_EVENT_INFO_TYPE_FID 1
120124 #define FAN_EVENT_INFO_TYPE_DFID_NAME 2
125+#define FAN_EVENT_INFO_TYPE_DFID 3
121126
122127 /* Variable length info record following event metadata */
123128 struct fanotify_event_info_header {
@@ -127,10 +132,11 @@ struct fanotify_event_info_header { · 3 unmodified lines
127132 };
128133
129134 /*
130− * Unique file identifier info record. This is used both for
131− * FAN_EVENT_INFO_TYPE_FID records and for FAN_EVENT_INFO_TYPE_DFID_NAME
132− * records. For FAN_EVENT_INFO_TYPE_DFID_NAME there is additionally a null
133− * terminated name immediately after the file handle.
135+ * Unique file identifier info record.
136+ * This structure is used for records of types FAN_EVENT_INFO_TYPE_FID,
137+ * FAN_EVENT_INFO_TYPE_DFID and FAN_EVENT_INFO_TYPE_DFID_NAME.
138+ * For FAN_EVENT_INFO_TYPE_DFID_NAME there is additionally a null terminated
139+ * name immediately after the file handle.
134140 */
135141 struct fanotify_event_info_fid {
136142 struct fanotify_event_info_header hdr;