dnotify.h 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _LINUX_DNOTIFY_H
  2. #define _LINUX_DNOTIFY_H
  3. /*
  4. * Directory notification for Linux
  5. *
  6. * Copyright (C) 2000,2002 Stephen Rothwell
  7. */
  8. #include <linux/fs.h>
  9. struct dnotify_struct {
  10. struct dnotify_struct * dn_next;
  11. __u32 dn_mask;
  12. int dn_fd;
  13. struct file * dn_filp;
  14. fl_owner_t dn_owner;
  15. };
  16. #ifdef __KERNEL__
  17. #ifdef CONFIG_DNOTIFY
  18. #define DNOTIFY_ALL_EVENTS (FS_DELETE | FS_DELETE_CHILD |\
  19. FS_MODIFY | FS_MODIFY_CHILD |\
  20. FS_ACCESS | FS_ACCESS_CHILD |\
  21. FS_ATTRIB | FS_ATTRIB_CHILD |\
  22. FS_CREATE | FS_DN_RENAME |\
  23. FS_MOVED_FROM | FS_MOVED_TO)
  24. extern int dir_notify_enable;
  25. extern void dnotify_flush(struct file *, fl_owner_t);
  26. extern int fcntl_dirnotify(int, struct file *, unsigned long);
  27. #else
  28. static inline void dnotify_flush(struct file *filp, fl_owner_t id)
  29. {
  30. }
  31. static inline int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
  32. {
  33. return -EINVAL;
  34. }
  35. #endif /* CONFIG_DNOTIFY */
  36. #endif /* __KERNEL __ */
  37. #endif /* _LINUX_DNOTIFY_H */