fanotify.h 914 B

123456789101112131415161718192021222324252627282930
  1. #include <linux/fsnotify_backend.h>
  2. #include <linux/path.h>
  3. #include <linux/slab.h>
  4. extern struct kmem_cache *fanotify_event_cachep;
  5. /*
  6. * Lifetime of the structure differs for normal and permission events. In both
  7. * cases the structure is allocated in fanotify_handle_event(). For normal
  8. * events the structure is freed immediately after reporting it to userspace.
  9. * For permission events we free it only after we receive response from
  10. * userspace.
  11. */
  12. struct fanotify_event_info {
  13. struct fsnotify_event fse;
  14. /*
  15. * We hold ref to this path so it may be dereferenced at any point
  16. * during this object's lifetime
  17. */
  18. struct path path;
  19. struct pid *tgid;
  20. #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
  21. u32 response; /* userspace answer to question */
  22. #endif
  23. };
  24. static inline struct fanotify_event_info *FANOTIFY_E(struct fsnotify_event *fse)
  25. {
  26. return container_of(fse, struct fanotify_event_info, fse);
  27. }