mount.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #include <linux/mount.h>
  2. #include <linux/seq_file.h>
  3. #include <linux/poll.h>
  4. struct mnt_namespace {
  5. atomic_t count;
  6. struct mount * root;
  7. struct list_head list;
  8. wait_queue_head_t poll;
  9. int event;
  10. };
  11. struct mnt_pcp {
  12. int mnt_count;
  13. int mnt_writers;
  14. };
  15. struct mount {
  16. struct list_head mnt_hash;
  17. struct mount *mnt_parent;
  18. struct dentry *mnt_mountpoint;
  19. struct vfsmount mnt;
  20. #ifdef CONFIG_SMP
  21. struct mnt_pcp __percpu *mnt_pcp;
  22. atomic_t mnt_longterm; /* how many of the refs are longterm */
  23. #else
  24. int mnt_count;
  25. int mnt_writers;
  26. #endif
  27. struct list_head mnt_mounts; /* list of children, anchored here */
  28. struct list_head mnt_child; /* and going through their mnt_child */
  29. struct list_head mnt_instance; /* mount instance on sb->s_mounts */
  30. const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
  31. struct list_head mnt_list;
  32. struct list_head mnt_expire; /* link in fs-specific expiry list */
  33. struct list_head mnt_share; /* circular list of shared mounts */
  34. struct list_head mnt_slave_list;/* list of slave mounts */
  35. struct list_head mnt_slave; /* slave list entry */
  36. struct mount *mnt_master; /* slave is on master->mnt_slave_list */
  37. struct mnt_namespace *mnt_ns; /* containing namespace */
  38. #ifdef CONFIG_FSNOTIFY
  39. struct hlist_head mnt_fsnotify_marks;
  40. __u32 mnt_fsnotify_mask;
  41. #endif
  42. int mnt_id; /* mount identifier */
  43. int mnt_group_id; /* peer group identifier */
  44. int mnt_expiry_mark; /* true if marked for expiry */
  45. int mnt_pinned;
  46. int mnt_ghosts;
  47. };
  48. static inline struct mount *real_mount(struct vfsmount *mnt)
  49. {
  50. return container_of(mnt, struct mount, mnt);
  51. }
  52. static inline int mnt_has_parent(struct mount *mnt)
  53. {
  54. return mnt != mnt->mnt_parent;
  55. }
  56. extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
  57. static inline void get_mnt_ns(struct mnt_namespace *ns)
  58. {
  59. atomic_inc(&ns->count);
  60. }
  61. struct proc_mounts {
  62. struct seq_file m; /* must be the first element */
  63. struct mnt_namespace *ns;
  64. struct path root;
  65. int (*show)(struct seq_file *, struct vfsmount *);
  66. };
  67. extern const struct seq_operations mounts_op;