mount.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. struct list_head mnt_mounts; /* list of children, anchored here */
  19. struct list_head mnt_child; /* and going through their mnt_child */
  20. /* yet to be moved - up to mnt_devname */
  21. struct list_head mnt_list;
  22. struct list_head mnt_expire; /* link in fs-specific expiry list */
  23. struct list_head mnt_share; /* circular list of shared mounts */
  24. struct list_head mnt_slave_list;/* list of slave mounts */
  25. struct list_head mnt_slave; /* slave list entry */
  26. struct mount *mnt_master; /* slave is on master->mnt_slave_list */
  27. struct mnt_namespace *mnt_ns; /* containing namespace */
  28. int mnt_id; /* mount identifier */
  29. int mnt_group_id; /* peer group identifier */
  30. int mnt_expiry_mark; /* true if marked for expiry */
  31. int mnt_pinned;
  32. int mnt_ghosts;
  33. };
  34. static inline struct mount *real_mount(struct vfsmount *mnt)
  35. {
  36. return container_of(mnt, struct mount, mnt);
  37. }
  38. static inline int mnt_has_parent(struct mount *mnt)
  39. {
  40. return mnt != mnt->mnt_parent;
  41. }
  42. extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);