History

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

Pull fsnotify updates from Jan Kara: "This implements the fanotify FAN_DIR_MODIFY event. This event reports the name in a directory under which a change happened and together with the directory filehandle and fstatat() allows reliable and efficient implementation of directory synchronization" * tag 'fsnotify_for_v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: Fix the checks in fanotify_fsid_equal fanotify: report name info for FAN_DIR_MODIFY event fanotify: record name info for FAN_DIR_MODIFY event fanotify: Drop fanotify_event_has_fid() fanotify: prepare to report both parent and child fid's fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name fanotify: divorce fanotify_path_event and fanotify_fid_event fanotify: Store fanotify handles differently fanotify: Simplify create_fd() fanotify: fix merging marks masks with FAN_ONDIR fanotify: merge duplicate events on parent and child fsnotify: replace inode pointer with an object id fsnotify: simplify arguments passing to fsnotify_parent() fsnotify: use helpers to access data by data_type fsnotify: funnel all dirent events through fsnotify_name() fsnotify: factor helpers fsnotify_dentry() and fsnotify_file() fsnotify: tidy up FS_ and FAN_ constants

Linus Torvalds committed 6 years ago

Commit b6ff1072 parents 74e934b 6def1a112 files · +637 −363Browse files

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

Unified · Split

include/uapi/linux/fanotify.h+10−3
@@ -24,10 +24,11 @@ · 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 */
2728
28−#define FAN_ONDIR 0x40000000 /* event occurred against dir */
29+#define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */
2930
30−#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
31+#define FAN_ONDIR 0x40000000 /* Event occurred against dir */
3132
3233 /* helper events */
3334 #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
@@ -116,6 +117,7 @@ struct fanotify_event_metadata { · 82 unmodified lines
116117 };
117118
118119 #define FAN_EVENT_INFO_TYPE_FID 1
120+#define FAN_EVENT_INFO_TYPE_DFID_NAME 2
119121
120122 /* Variable length info record following event metadata */
121123 struct fanotify_event_info_header {
@@ -124,7 +126,12 @@ struct fanotify_event_info_header { · 2 unmodified lines
124126 __u16 len;
125127 };
126128
127−/* Unique file identifier info record */
129+/*
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.
134+ */
128135 struct fanotify_event_info_fid {
129136 struct fanotify_event_info_header hdr;
130137 __kernel_fsid_t fsid;