Thread (26 messages) flat view 26 messages, 5 authors, 2021-05-24
STALE1952d

Revision v1 of 7 in this series.

Revisions (7)
  1. rfc [diff vs current]
  2. v1 current
  3. v2 [diff vs current]
  4. v3 [diff vs current]
  5. v4 [diff vs current]
  6. v5 [diff vs current]
  7. v6 [diff vs current]

[PATCH 07/11] fsnotify: Introduce helpers to send error_events

From: Gabriel Krisman Bertazi <hidden>
Date: 2021-05-21 02:42:25
Also in: linux-fsdevel
Subsystem: fsnotify: filesystem notification infrastructure, the rest · Maintainers: Jan Kara, Linus Torvalds

Signed-off-by: Gabriel Krisman Bertazi <redacted>

---
Changes since v2:
  - Use the inode argument (Amir)
---
 include/linux/fsnotify.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index f8acddcf54fb..458e4feb5fe1 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -317,4 +317,17 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
 		fsnotify_dentry(dentry, mask);
 }
 
+static inline void fsnotify_error_event(struct super_block *sb, struct inode *inode,
+					int error)
+{
+	if (sb->s_fsnotify_marks) {
+		struct fs_error_report report = {
+			.error = error,
+			.inode = inode,
+		};
+		fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR, NULL, NULL,
+			 sb->s_root->d_inode, 0);
+	}
+}
+
 #endif	/* _LINUX_FS_NOTIFY_H */
-- 
2.31.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help