Al Viro | b2dba1a | 2011-11-23 19:26:23 -0500 | [diff] [blame] | 1 | #include <linux/mount.h> |
| 2 | |
Al Viro | 68e8a9f | 2011-11-24 22:53:09 -0500 | [diff] [blame] | 3 | struct mnt_pcp { |
| 4 | int mnt_count; |
| 5 | int mnt_writers; |
| 6 | }; |
| 7 | |
Al Viro | 7d6fec4 | 2011-11-23 12:14:10 -0500 | [diff] [blame] | 8 | struct mount { |
Al Viro | 1b8e556 | 2011-11-24 21:01:32 -0500 | [diff] [blame] | 9 | struct list_head mnt_hash; |
Al Viro | 0714a53 | 2011-11-24 22:19:58 -0500 | [diff] [blame] | 10 | struct mount *mnt_parent; |
Al Viro | a73324d | 2011-11-24 22:25:07 -0500 | [diff] [blame] | 11 | struct dentry *mnt_mountpoint; |
Al Viro | 7d6fec4 | 2011-11-23 12:14:10 -0500 | [diff] [blame] | 12 | struct vfsmount mnt; |
Al Viro | 68e8a9f | 2011-11-24 22:53:09 -0500 | [diff] [blame] | 13 | #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 Viro | 6b41d53 | 2011-11-24 23:24:33 -0500 | [diff] [blame] | 20 | struct list_head mnt_mounts; /* list of children, anchored here */ |
| 21 | struct list_head mnt_child; /* and going through their mnt_child */ |
Al Viro | 1a4eeaf | 2011-11-25 02:19:55 -0500 | [diff] [blame^] | 22 | /* yet to be moved - up to mnt_devname */ |
| 23 | struct list_head mnt_list; |
Al Viro | 6776db3d | 2011-11-25 00:22:05 -0500 | [diff] [blame] | 24 | 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 Viro | 3230192 | 2011-11-25 00:10:28 -0500 | [diff] [blame] | 28 | struct mount *mnt_master; /* slave is on master->mnt_slave_list */ |
Al Viro | 143c8c9 | 2011-11-25 00:46:35 -0500 | [diff] [blame] | 29 | struct mnt_namespace *mnt_ns; /* containing namespace */ |
Al Viro | 15169fe | 2011-11-25 00:50:41 -0500 | [diff] [blame] | 30 | int mnt_id; /* mount identifier */ |
| 31 | int mnt_group_id; /* peer group identifier */ |
Al Viro | 863d684 | 2011-11-25 00:57:42 -0500 | [diff] [blame] | 32 | int mnt_expiry_mark; /* true if marked for expiry */ |
| 33 | int mnt_pinned; |
| 34 | int mnt_ghosts; |
Al Viro | 7d6fec4 | 2011-11-23 12:14:10 -0500 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | static inline struct mount *real_mount(struct vfsmount *mnt) |
| 38 | { |
| 39 | return container_of(mnt, struct mount, mnt); |
| 40 | } |
| 41 | |
Al Viro | 676da58 | 2011-11-24 21:47:05 -0500 | [diff] [blame] | 42 | static inline int mnt_has_parent(struct mount *mnt) |
Al Viro | b2dba1a | 2011-11-23 19:26:23 -0500 | [diff] [blame] | 43 | { |
Al Viro | 0714a53 | 2011-11-24 22:19:58 -0500 | [diff] [blame] | 44 | return mnt != mnt->mnt_parent; |
Al Viro | b2dba1a | 2011-11-23 19:26:23 -0500 | [diff] [blame] | 45 | } |
Al Viro | c710536 | 2011-11-24 18:22:03 -0500 | [diff] [blame] | 46 | |
| 47 | extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int); |