Merge tag 'v5.18-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6-microblaze.git] / include / linux / fsnotify_backend.h
index 790c318..0805b74 100644 (file)
@@ -601,6 +601,25 @@ extern void fsnotify_remove_queued_event(struct fsnotify_group *group,
 
 /* functions used to manipulate the marks attached to inodes */
 
+/* Get mask for calculating object interest taking ignored mask into account */
+static inline __u32 fsnotify_calc_mask(struct fsnotify_mark *mark)
+{
+       __u32 mask = mark->mask;
+
+       if (!mark->ignored_mask)
+               return mask;
+
+       /* Interest in FS_MODIFY may be needed for clearing ignored mask */
+       if (!(mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY))
+               mask |= FS_MODIFY;
+
+       /*
+        * If mark is interested in ignoring events on children, the object must
+        * show interest in those events for fsnotify_parent() to notice it.
+        */
+       return mask | (mark->ignored_mask & ALL_FSNOTIFY_EVENTS);
+}
+
 /* Get mask of events for a list of marks */
 extern __u32 fsnotify_conn_mask(struct fsnotify_mark_connector *conn);
 /* Calculate mask of events for a list of marks */