dnotify.h 1014 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_DNOTIFY_H
  3. #define _LINUX_DNOTIFY_H
  4. /*
  5. * Directory notification for Linux
  6. *
  7. * Copyright (C) 2000,2002 Stephen Rothwell
  8. */
  9. #include <linux/fs.h>
  10. struct dnotify_struct {
  11. struct dnotify_struct * dn_next;
  12. __u32 dn_mask;
  13. int dn_fd;
  14. struct file * dn_filp;
  15. fl_owner_t dn_owner;
  16. };
  17. #ifdef __KERNEL__
  18. #ifdef CONFIG_DNOTIFY
  19. #define DNOTIFY_ALL_EVENTS (FS_DELETE | FS_DELETE_CHILD |\
  20. FS_MODIFY | FS_MODIFY_CHILD |\
  21. FS_ACCESS | FS_ACCESS_CHILD |\
  22. FS_ATTRIB | FS_ATTRIB_CHILD |\
  23. FS_CREATE | FS_RENAME |\
  24. FS_MOVED_FROM | FS_MOVED_TO)
  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 */