fsnotify.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __FS_NOTIFY_FSNOTIFY_H_
  2. #define __FS_NOTIFY_FSNOTIFY_H_
  3. #include <linux/list.h>
  4. #include <linux/fsnotify.h>
  5. #include <linux/srcu.h>
  6. #include <linux/types.h>
  7. #include "../mount.h"
  8. struct fsnotify_iter_info {
  9. struct fsnotify_mark *inode_mark;
  10. struct fsnotify_mark *vfsmount_mark;
  11. int srcu_idx;
  12. };
  13. /* destroy all events sitting in this groups notification queue */
  14. extern void fsnotify_flush_notify(struct fsnotify_group *group);
  15. /* protects reads of inode and vfsmount marks list */
  16. extern struct srcu_struct fsnotify_mark_srcu;
  17. /* compare two groups for sorting of marks lists */
  18. extern int fsnotify_compare_groups(struct fsnotify_group *a,
  19. struct fsnotify_group *b);
  20. /* Destroy all marks connected via given connector */
  21. extern void fsnotify_destroy_marks(struct fsnotify_mark_connector __rcu **connp);
  22. /* run the list of all marks associated with inode and destroy them */
  23. static inline void fsnotify_clear_marks_by_inode(struct inode *inode)
  24. {
  25. fsnotify_destroy_marks(&inode->i_fsnotify_marks);
  26. }
  27. /* run the list of all marks associated with vfsmount and destroy them */
  28. static inline void fsnotify_clear_marks_by_mount(struct vfsmount *mnt)
  29. {
  30. fsnotify_destroy_marks(&real_mount(mnt)->mnt_fsnotify_marks);
  31. }
  32. /* Wait until all marks queued for destruction are destroyed */
  33. extern void fsnotify_wait_marks_destroyed(void);
  34. /*
  35. * update the dentry->d_flags of all of inode's children to indicate if inode cares
  36. * about events that happen to its children.
  37. */
  38. extern void __fsnotify_update_child_dentry_flags(struct inode *inode);
  39. /* allocate and destroy and event holder to attach events to notification/access queues */
  40. extern struct fsnotify_event_holder *fsnotify_alloc_event_holder(void);
  41. extern void fsnotify_destroy_event_holder(struct fsnotify_event_holder *holder);
  42. #endif /* __FS_NOTIFY_FSNOTIFY_H_ */