mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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>
This commit is contained in:
committed by
Jan Kara
parent
4fe595cf1c
commit
9daa811073
@@ -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 */
|
||||
|
Reference in New Issue
Block a user