dnotify.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. unsigned long 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. extern void __inode_dir_notify(struct inode *, unsigned long);
  19. extern void dnotify_flush(struct file *, fl_owner_t);
  20. extern int fcntl_dirnotify(int, struct file *, unsigned long);
  21. extern void dnotify_parent(struct dentry *, unsigned long);
  22. static inline void inode_dir_notify(struct inode *inode, unsigned long event)
  23. {
  24. if (inode->i_dnotify_mask & (event))
  25. __inode_dir_notify(inode, event);
  26. }
  27. #else
  28. static inline void __inode_dir_notify(struct inode *inode, unsigned long event)
  29. {
  30. }
  31. static inline void dnotify_flush(struct file *filp, fl_owner_t id)
  32. {
  33. }
  34. static inline int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
  35. {
  36. return -EINVAL;
  37. }
  38. static inline void dnotify_parent(struct dentry *dentry, unsigned long event)
  39. {
  40. }
  41. static inline void inode_dir_notify(struct inode *inode, unsigned long event)
  42. {
  43. }
  44. #endif /* CONFIG_DNOTIFY */
  45. #endif /* __KERNEL __ */
  46. #endif /* _LINUX_DNOTIFY_H */