diff options
author | Gabriel Krisman Bertazi <krisman@collabora.com> | 2021-10-25 22:27:35 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2021-10-27 13:35:10 +0300 |
commit | 83e9acbe13dc1b767f91b5c1350f7a65689b26f6 (patch) | |
tree | fe96991c91f1e36d15dcd69c68362cc60d52045d /fs/notify/fanotify/fanotify.h | |
parent | 734a1a5eccc5f7473002b0669f788e135f1f64aa (diff) | |
download | linux-83e9acbe13dc1b767f91b5c1350f7a65689b26f6.tar.xz |
fanotify: Support enqueueing of error events
Once an error event is triggered, enqueue it in the notification group,
similarly to what is done for other events. FAN_FS_ERROR is not
handled specially, since the memory is now handled by a preallocated
mempool.
For now, make the event unhashed. A future patch implements merging of
this kind of event.
Link: https://lore.kernel.org/r/20211025192746.66445-21-krisman@collabora.com
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/fanotify/fanotify.h')
-rw-r--r-- | fs/notify/fanotify/fanotify.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/notify/fanotify/fanotify.h b/fs/notify/fanotify/fanotify.h index a577e87fac2b..ebef952481fa 100644 --- a/fs/notify/fanotify/fanotify.h +++ b/fs/notify/fanotify/fanotify.h @@ -298,6 +298,11 @@ static inline struct fanotify_event *FANOTIFY_E(struct fsnotify_event *fse) return container_of(fse, struct fanotify_event, fse); } +static inline bool fanotify_is_error_event(u32 mask) +{ + return mask & FAN_FS_ERROR; +} + static inline bool fanotify_event_has_path(struct fanotify_event *event) { return event->type == FANOTIFY_EVENT_TYPE_PATH || @@ -327,6 +332,7 @@ static inline struct path *fanotify_event_path(struct fanotify_event *event) static inline bool fanotify_is_hashed_event(u32 mask) { return !(fanotify_is_perm_event(mask) || + fanotify_is_error_event(mask) || fsnotify_is_overflow_event(mask)); } |