inotify: move control flags from mask to mark flags
[platform/kernel/linux-starfive.git] / fs / notify / inotify / inotify.h
index 8f00151..7d5df7a 100644 (file)
@@ -27,11 +27,18 @@ static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
  * userspace.  There is at least one bit (FS_EVENT_ON_CHILD) which is
  * used only internally to the kernel.
  */
-#define INOTIFY_USER_MASK (IN_ALL_EVENTS | IN_ONESHOT | IN_EXCL_UNLINK)
+#define INOTIFY_USER_MASK (IN_ALL_EVENTS)
 
 static inline __u32 inotify_mark_user_mask(struct fsnotify_mark *fsn_mark)
 {
-       return fsn_mark->mask & INOTIFY_USER_MASK;
+       __u32 mask = fsn_mark->mask & INOTIFY_USER_MASK;
+
+       if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_EXCL_UNLINK)
+               mask |= IN_EXCL_UNLINK;
+       if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_IN_ONESHOT)
+               mask |= IN_ONESHOT;
+
+       return mask;
 }
 
 extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,