diff options
author | Gabriel Krisman Bertazi <krisman@collabora.com> | 2021-10-25 22:27:32 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2021-10-27 13:34:49 +0300 |
commit | 9daa811073fa19c08e8aad3b90f9235fed161acf (patch) | |
tree | 370ac5cdd4e5115db505d591c4f9954dafa6921c /include/linux/fsnotify.h | |
parent | 4fe595cf1c80e7a5af4d00c4da29def64aff57a2 (diff) | |
download | linux-9daa811073fa19c08e8aad3b90f9235fed161acf.tar.xz |
fsnotify: Support FS_ERROR event type
Expose a new type of fsnotify event for filesystems to report errors for
userspace monitoring tools. fanotify will send this type of
notification for FAN_FS_ERROR events. This also introduce a helper for
generating the new event.
Link: https://lore.kernel.org/r/20211025192746.66445-18-krisman@collabora.com
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/fsnotify.h')
-rw-r--r-- | include/linux/fsnotify.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 1e5f7435a4b5..787545e87eeb 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -339,4 +339,17 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) fsnotify_dentry(dentry, mask); } +static inline int fsnotify_sb_error(struct super_block *sb, struct inode *inode, + int error) +{ + struct fs_error_report report = { + .error = error, + .inode = inode, + .sb = sb, + }; + + return fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR, + NULL, NULL, NULL, 0); +} + #endif /* _LINUX_FS_NOTIFY_H */ |