path.h 572 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_PATH_H
  3. #define _LINUX_PATH_H
  4. struct dentry;
  5. struct vfsmount;
  6. struct path {
  7. struct vfsmount *mnt;
  8. struct dentry *dentry;
  9. } __randomize_layout;
  10. extern void path_get(const struct path *);
  11. extern void path_put(const struct path *);
  12. static inline int path_equal(const struct path *path1, const struct path *path2)
  13. {
  14. return path1->mnt == path2->mnt && path1->dentry == path2->dentry;
  15. }
  16. static inline void path_put_init(struct path *path)
  17. {
  18. path_put(path);
  19. *path = (struct path) { };
  20. }
  21. #endif /* _LINUX_PATH_H */