inotify.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include <linux/fsnotify_backend.h>
  2. #include <linux/inotify.h>
  3. #include <linux/slab.h> /* struct kmem_cache */
  4. struct inotify_event_info {
  5. struct fsnotify_event fse;
  6. int wd;
  7. u32 sync_cookie;
  8. int name_len;
  9. char name[];
  10. };
  11. struct inotify_inode_mark {
  12. struct fsnotify_mark fsn_mark;
  13. int wd;
  14. };
  15. static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
  16. {
  17. return container_of(fse, struct inotify_event_info, fse);
  18. }
  19. extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
  20. struct fsnotify_group *group);
  21. extern int inotify_handle_event(struct fsnotify_group *group,
  22. struct inode *inode,
  23. struct fsnotify_mark *inode_mark,
  24. struct fsnotify_mark *vfsmount_mark,
  25. u32 mask, const void *data, int data_type,
  26. const unsigned char *file_name, u32 cookie);
  27. extern const struct fsnotify_ops inotify_fsnotify_ops;
  28. #ifdef CONFIG_INOTIFY_USER
  29. static inline void dec_inotify_instances(struct ucounts *ucounts)
  30. {
  31. dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
  32. }
  33. static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
  34. {
  35. return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
  36. }
  37. static inline void dec_inotify_watches(struct ucounts *ucounts)
  38. {
  39. dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
  40. }
  41. #endif