diff options
author | Amir Goldstein <amir73il@gmail.com> | 2022-04-22 15:03:13 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2022-04-25 14:37:06 +0200 |
commit | 38035c04f5865c4ef9597d6beed6a7178f90f64a (patch) | |
tree | f77e39bb7ffad2ecd03eb2bb1461d21e9f16c5b5 /fs/notify/inotify/inotify.h | |
parent | a32e697cda27679a0327ae2cafdad8c7170f548f (diff) | |
download | linux-38035c04f5865c4ef9597d6beed6a7178f90f64a.tar.bz2 |
inotify: move control flags from mask to mark flags
The inotify control flags in the mark mask (e.g. FS_IN_ONE_SHOT) are not
relevant to object interest mask, so move them to the mark flags.
This frees up some bits in the object interest mask.
Link: https://lore.kernel.org/r/20220422120327.3459282-3-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/inotify/inotify.h')
-rw-r--r-- | fs/notify/inotify/inotify.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/notify/inotify/inotify.h b/fs/notify/inotify/inotify.h index 8f00151eb731..7d5df7a21539 100644 --- a/fs/notify/inotify/inotify.h +++ b/fs/notify/inotify/inotify.h @@ -27,11 +27,18 @@ static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse) * userspace. There is at least one bit (FS_EVENT_ON_CHILD) which is * used only internally to the kernel. */ -#define INOTIFY_USER_MASK (IN_ALL_EVENTS | IN_ONESHOT | IN_EXCL_UNLINK) +#define INOTIFY_USER_MASK (IN_ALL_EVENTS) static inline __u32 inotify_mark_user_mask(struct fsnotify_mark *fsn_mark) { - return fsn_mark->mask & INOTIFY_USER_MASK; + __u32 mask = fsn_mark->mask & INOTIFY_USER_MASK; + + if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_EXCL_UNLINK) + mask |= IN_EXCL_UNLINK; + if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_IN_ONESHOT) + mask |= IN_ONESHOT; + + return mask; } extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark, |