Pull fsnotify updates from Jan Kara: "Amir's patches to implement superblock fanotify watches, Xiaoming's patch to enable reporting of thread IDs in fanotify events instead of TGIDs (sadly the patch got mis-attributed to Amir and I've noticed only now), and a fix of possible oops on umount caused by fsnotify infrastructure" * tag 'for_v4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fsnotify: Fix busy inodes during unmount fs: group frequently accessed fields of struct super_block together fanotify: support reporting thread id instead of process id fanotify: add BUILD_BUG_ON() to count the bits of fanotify constants fsnotify: convert runtime BUG_ON() to BUILD_BUG_ON() fanotify: deprecate uapi FAN_ALL_* constants fanotify: simplify handling of FAN_ONDIR fsnotify: generalize handling of extra event flags fanotify: fix collision of internal and uapi mark flags fanotify: store fanotify_init() flags in group's fanotify_data fanotify: add API to attach/detach super block mark fsnotify: send path type events to group with super block marks fsnotify: add super block object type
Showing the changes to include/uapi/linux (1 of 13 files). Show all
Unified · Split
| @@ -27,10 +27,12 @@ · 26 unmodified lines | ||
| 27 | 27 | #define FAN_CLOEXEC 0x00000001 |
| 28 | 28 | #define FAN_NONBLOCK 0x00000002 |
| 29 | 29 | |
| 30 | −/* These are NOT bitwise flags. Both bits are used togther. */ | |
| 30 | +/* These are NOT bitwise flags. Both bits are used together. */ | |
| 31 | 31 | #define FAN_CLASS_NOTIF 0x00000000 |
| 32 | 32 | #define FAN_CLASS_CONTENT 0x00000004 |
| 33 | 33 | #define FAN_CLASS_PRE_CONTENT 0x00000008 |
| 34 | + | |
| 35 | +/* Deprecated - do not use this in programs and do not add new flags here! */ | |
| 34 | 36 | #define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ |
| 35 | 37 | FAN_CLASS_PRE_CONTENT) |
| 36 | 38 | |
| @@ -38,6 +40,10 @@ · 1 unmodified line | ||
| 38 | 40 | #define FAN_UNLIMITED_MARKS 0x00000020 |
| 39 | 41 | #define FAN_ENABLE_AUDIT 0x00000040 |
| 40 | 42 | |
| 43 | +/* Flags to determine fanotify event format */ | |
| 44 | +#define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */ | |
| 45 | + | |
| 46 | +/* Deprecated - do not use this in programs and do not add new flags here! */ | |
| 41 | 47 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ |
| 42 | 48 | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\ |
| 43 | 49 | FAN_UNLIMITED_MARKS) |
| @@ -47,11 +53,18 @@ · 3 unmodified lines | ||
| 47 | 53 | #define FAN_MARK_REMOVE 0x00000002 |
| 48 | 54 | #define FAN_MARK_DONT_FOLLOW 0x00000004 |
| 49 | 55 | #define FAN_MARK_ONLYDIR 0x00000008 |
| 50 | −#define FAN_MARK_MOUNT 0x00000010 | |
| 56 | +/* FAN_MARK_MOUNT is 0x00000010 */ | |
| 51 | 57 | #define FAN_MARK_IGNORED_MASK 0x00000020 |
| 52 | 58 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 |
| 53 | 59 | #define FAN_MARK_FLUSH 0x00000080 |
| 60 | +/* FAN_MARK_FILESYSTEM is 0x00000100 */ | |
| 54 | 61 | |
| 62 | +/* These are NOT bitwise flags. Both bits can be used togther. */ | |
| 63 | +#define FAN_MARK_INODE 0x00000000 | |
| 64 | +#define FAN_MARK_MOUNT 0x00000010 | |
| 65 | +#define FAN_MARK_FILESYSTEM 0x00000100 | |
| 66 | + | |
| 67 | +/* Deprecated - do not use this in programs and do not add new flags here! */ | |
| 55 | 68 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ |
| 56 | 69 | FAN_MARK_REMOVE |\ |
| 57 | 70 | FAN_MARK_DONT_FOLLOW |\ |
| @@ -61,11 +74,7 @@ · 3 unmodified lines | ||
| 61 | 74 | FAN_MARK_IGNORED_SURV_MODIFY |\ |
| 62 | 75 | FAN_MARK_FLUSH) |
| 63 | 76 | |
| 64 | −/* | |
| 65 | − * All of the events - we build the list by hand so that we can add flags in | |
| 66 | − * the future and not break backward compatibility. Apps will get only the | |
| 67 | − * events that they originally wanted. Be sure to add new events here! | |
| 68 | − */ | |
| 77 | +/* Deprecated - do not use this in programs and do not add new flags here! */ | |
| 69 | 78 | #define FAN_ALL_EVENTS (FAN_ACCESS |\ |
| 70 | 79 | FAN_MODIFY |\ |
| 71 | 80 | FAN_CLOSE |\ |
| @@ -74,9 +83,11 @@ · 2 unmodified lines | ||
| 74 | 83 | /* |
| 75 | 84 | * All events which require a permission response from userspace |
| 76 | 85 | */ |
| 86 | +/* Deprecated - do not use this in programs and do not add new flags here! */ | |
| 77 | 87 | #define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\ |
| 78 | 88 | FAN_ACCESS_PERM) |
| 79 | 89 | |
| 90 | +/* Deprecated - do not use this in programs and do not add new flags here! */ | |
| 80 | 91 | #define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\ |
| 81 | 92 | FAN_ALL_PERM_EVENTS |\ |
| 82 | 93 | FAN_Q_OVERFLOW) |