xref: /openbmc/linux/fs/mount.h (revision 1a4eeaf2)
1b2dba1afSAl Viro #include <linux/mount.h>
2b2dba1afSAl Viro 
368e8a9feSAl Viro struct mnt_pcp {
468e8a9feSAl Viro 	int mnt_count;
568e8a9feSAl Viro 	int mnt_writers;
668e8a9feSAl Viro };
768e8a9feSAl Viro 
87d6fec45SAl Viro struct mount {
91b8e5564SAl Viro 	struct list_head mnt_hash;
100714a533SAl Viro 	struct mount *mnt_parent;
11a73324daSAl Viro 	struct dentry *mnt_mountpoint;
127d6fec45SAl Viro 	struct vfsmount mnt;
1368e8a9feSAl Viro #ifdef CONFIG_SMP
1468e8a9feSAl Viro 	struct mnt_pcp __percpu *mnt_pcp;
1568e8a9feSAl Viro 	atomic_t mnt_longterm;		/* how many of the refs are longterm */
1668e8a9feSAl Viro #else
1768e8a9feSAl Viro 	int mnt_count;
1868e8a9feSAl Viro 	int mnt_writers;
1968e8a9feSAl Viro #endif
206b41d536SAl Viro 	struct list_head mnt_mounts;	/* list of children, anchored here */
216b41d536SAl Viro 	struct list_head mnt_child;	/* and going through their mnt_child */
221a4eeaf2SAl Viro 	/* yet to be moved - up to mnt_devname */
231a4eeaf2SAl Viro 	struct list_head mnt_list;
246776db3dSAl Viro 	struct list_head mnt_expire;	/* link in fs-specific expiry list */
256776db3dSAl Viro 	struct list_head mnt_share;	/* circular list of shared mounts */
266776db3dSAl Viro 	struct list_head mnt_slave_list;/* list of slave mounts */
276776db3dSAl Viro 	struct list_head mnt_slave;	/* slave list entry */
2832301920SAl Viro 	struct mount *mnt_master;	/* slave is on master->mnt_slave_list */
29143c8c91SAl Viro 	struct mnt_namespace *mnt_ns;	/* containing namespace */
3015169fe7SAl Viro 	int mnt_id;			/* mount identifier */
3115169fe7SAl Viro 	int mnt_group_id;		/* peer group identifier */
32863d684fSAl Viro 	int mnt_expiry_mark;		/* true if marked for expiry */
33863d684fSAl Viro 	int mnt_pinned;
34863d684fSAl Viro 	int mnt_ghosts;
357d6fec45SAl Viro };
367d6fec45SAl Viro 
377d6fec45SAl Viro static inline struct mount *real_mount(struct vfsmount *mnt)
387d6fec45SAl Viro {
397d6fec45SAl Viro 	return container_of(mnt, struct mount, mnt);
407d6fec45SAl Viro }
417d6fec45SAl Viro 
42676da58dSAl Viro static inline int mnt_has_parent(struct mount *mnt)
43b2dba1afSAl Viro {
440714a533SAl Viro 	return mnt != mnt->mnt_parent;
45b2dba1afSAl Viro }
46c7105365SAl Viro 
47c7105365SAl Viro extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
48