inotify.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. struct fsnotify_iter_info *iter_info);
  28. extern const struct fsnotify_ops inotify_fsnotify_ops;
  29. extern struct kmem_cache *inotify_inode_mark_cachep;
  30. #ifdef CONFIG_INOTIFY_USER
  31. static inline void dec_inotify_instances(struct ucounts *ucounts)
  32. {
  33. dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
  34. }
  35. static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
  36. {
  37. return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
  38. }
  39. static inline void dec_inotify_watches(struct ucounts *ucounts)
  40. {
  41. dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
  42. }
  43. #endif