mount.h 651 B

1234567891011121314151617181920212223242526272829303132
  1. #include <linux/mount.h>
  2. struct mnt_pcp {
  3. int mnt_count;
  4. int mnt_writers;
  5. };
  6. struct mount {
  7. struct list_head mnt_hash;
  8. struct mount *mnt_parent;
  9. struct dentry *mnt_mountpoint;
  10. struct vfsmount mnt;
  11. #ifdef CONFIG_SMP
  12. struct mnt_pcp __percpu *mnt_pcp;
  13. atomic_t mnt_longterm; /* how many of the refs are longterm */
  14. #else
  15. int mnt_count;
  16. int mnt_writers;
  17. #endif
  18. };
  19. static inline struct mount *real_mount(struct vfsmount *mnt)
  20. {
  21. return container_of(mnt, struct mount, mnt);
  22. }
  23. static inline int mnt_has_parent(struct mount *mnt)
  24. {
  25. return mnt != mnt->mnt_parent;
  26. }
  27. extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);