xref: /openbmc/linux/fs/mount.h (revision 143c8c91)
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 */
226776db3dSAl Viro 	/* yet to be moved - up to mnt_list */
236776db3dSAl Viro 	struct list_head mnt_expire;	/* link in fs-specific expiry list */
246776db3dSAl Viro 	struct list_head mnt_share;	/* circular list of shared mounts */
256776db3dSAl Viro 	struct list_head mnt_slave_list;/* list of slave mounts */
266776db3dSAl Viro 	struct list_head mnt_slave;	/* slave list entry */
2732301920SAl Viro 	struct mount *mnt_master;	/* slave is on master->mnt_slave_list */
28143c8c91SAl Viro 	struct mnt_namespace *mnt_ns;	/* containing namespace */
297d6fec45SAl Viro };
307d6fec45SAl Viro 
317d6fec45SAl Viro static inline struct mount *real_mount(struct vfsmount *mnt)
327d6fec45SAl Viro {
337d6fec45SAl Viro 	return container_of(mnt, struct mount, mnt);
347d6fec45SAl Viro }
357d6fec45SAl Viro 
36676da58dSAl Viro static inline int mnt_has_parent(struct mount *mnt)
37b2dba1afSAl Viro {
380714a533SAl Viro 	return mnt != mnt->mnt_parent;
39b2dba1afSAl Viro }
40c7105365SAl Viro 
41c7105365SAl Viro extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
42