blob: e094c863c8af54a94c161ffb93bb3580f3f98d50 [file] [log] [blame]
Al Virob2dba1a2011-11-23 19:26:23 -05001#include <linux/mount.h>
2
Al Viro68e8a9f2011-11-24 22:53:09 -05003struct mnt_pcp {
4 int mnt_count;
5 int mnt_writers;
6};
7
Al Viro7d6fec42011-11-23 12:14:10 -05008struct mount {
Al Viro1b8e5562011-11-24 21:01:32 -05009 struct list_head mnt_hash;
Al Viro0714a532011-11-24 22:19:58 -050010 struct mount *mnt_parent;
Al Viroa73324d2011-11-24 22:25:07 -050011 struct dentry *mnt_mountpoint;
Al Viro7d6fec42011-11-23 12:14:10 -050012 struct vfsmount mnt;
Al Viro68e8a9f2011-11-24 22:53:09 -050013#ifdef CONFIG_SMP
14 struct mnt_pcp __percpu *mnt_pcp;
15 atomic_t mnt_longterm; /* how many of the refs are longterm */
16#else
17 int mnt_count;
18 int mnt_writers;
19#endif
Al Viro6b41d532011-11-24 23:24:33 -050020 struct list_head mnt_mounts; /* list of children, anchored here */
21 struct list_head mnt_child; /* and going through their mnt_child */
Al Viro52ba1622011-11-25 02:25:17 -050022 const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
Al Viro1a4eeaf2011-11-25 02:19:55 -050023 struct list_head mnt_list;
Al Viro6776db3d2011-11-25 00:22:05 -050024 struct list_head mnt_expire; /* link in fs-specific expiry list */
25 struct list_head mnt_share; /* circular list of shared mounts */
26 struct list_head mnt_slave_list;/* list of slave mounts */
27 struct list_head mnt_slave; /* slave list entry */
Al Viro32301922011-11-25 00:10:28 -050028 struct mount *mnt_master; /* slave is on master->mnt_slave_list */
Al Viro143c8c92011-11-25 00:46:35 -050029 struct mnt_namespace *mnt_ns; /* containing namespace */
Al Viroc63181e2011-11-25 02:35:16 -050030#ifdef CONFIG_FSNOTIFY
31 struct hlist_head mnt_fsnotify_marks;
32 __u32 mnt_fsnotify_mask;
33#endif
Al Viro15169fe2011-11-25 00:50:41 -050034 int mnt_id; /* mount identifier */
35 int mnt_group_id; /* peer group identifier */
Al Viro863d6842011-11-25 00:57:42 -050036 int mnt_expiry_mark; /* true if marked for expiry */
37 int mnt_pinned;
38 int mnt_ghosts;
Al Viro7d6fec42011-11-23 12:14:10 -050039};
40
41static inline struct mount *real_mount(struct vfsmount *mnt)
42{
43 return container_of(mnt, struct mount, mnt);
44}
45
Al Viro676da582011-11-24 21:47:05 -050046static inline int mnt_has_parent(struct mount *mnt)
Al Virob2dba1a2011-11-23 19:26:23 -050047{
Al Viro0714a532011-11-24 22:19:58 -050048 return mnt != mnt->mnt_parent;
Al Virob2dba1a2011-11-23 19:26:23 -050049}
Al Viroc7105362011-11-24 18:22:03 -050050
51extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);