dcookies.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * dcookies.h
  3. *
  4. * Persistent cookie-path mappings
  5. *
  6. * Copyright 2002 John Levon <levon@movementarian.org>
  7. */
  8. #ifndef DCOOKIES_H
  9. #define DCOOKIES_H
  10. #ifdef CONFIG_PROFILING
  11. #include <linux/dcache.h>
  12. #include <linux/types.h>
  13. struct dcookie_user;
  14. struct path;
  15. /**
  16. * dcookie_register - register a user of dcookies
  17. *
  18. * Register as a dcookie user. Returns %NULL on failure.
  19. */
  20. struct dcookie_user * dcookie_register(void);
  21. /**
  22. * dcookie_unregister - unregister a user of dcookies
  23. *
  24. * Unregister as a dcookie user. This may invalidate
  25. * any dcookie values returned from get_dcookie().
  26. */
  27. void dcookie_unregister(struct dcookie_user * user);
  28. /**
  29. * get_dcookie - acquire a dcookie
  30. *
  31. * Convert the given dentry/vfsmount pair into
  32. * a cookie value.
  33. *
  34. * Returns -EINVAL if no living task has registered as a
  35. * dcookie user.
  36. *
  37. * Returns 0 on success, with *cookie filled in
  38. */
  39. int get_dcookie(struct path *path, unsigned long *cookie);
  40. #else
  41. static inline struct dcookie_user * dcookie_register(void)
  42. {
  43. return NULL;
  44. }
  45. static inline void dcookie_unregister(struct dcookie_user * user)
  46. {
  47. return;
  48. }
  49. static inline int get_dcookie(struct path *path, unsigned long *cookie)
  50. {
  51. return -ENOSYS;
  52. }
  53. #endif /* CONFIG_PROFILING */
  54. #endif /* DCOOKIES_H */