fanotify.h 738 B

1234567891011121314151617181920212223242526272829303132
  1. #include <linux/fanotify.h>
  2. #include <linux/fsnotify_backend.h>
  3. #include <linux/net.h>
  4. #include <linux/kernel.h>
  5. #include <linux/types.h>
  6. extern const struct fsnotify_ops fanotify_fsnotify_ops;
  7. static inline bool fanotify_mark_flags_valid(unsigned int flags)
  8. {
  9. /* must be either and add or a remove */
  10. if (!(flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)))
  11. return false;
  12. /* cannot be both add and remove */
  13. if ((flags & FAN_MARK_ADD) &&
  14. (flags & FAN_MARK_REMOVE))
  15. return false;
  16. /* cannot have more flags than we know about */
  17. if (flags & ~FAN_ALL_MARK_FLAGS)
  18. return false;
  19. return true;
  20. }
  21. static inline bool fanotify_mask_valid(__u32 mask)
  22. {
  23. if (mask & ~((__u32)FAN_ALL_INCOMING_EVENTS))
  24. return false;
  25. return true;
  26. }