]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - fs/mount.h
vfs: take mnt_child/mnt_mounts to struct mount
[mirror_ubuntu-zesty-kernel.git] / fs / mount.h
1 #include <linux/mount.h>
2
3 struct mnt_pcp {
4 int mnt_count;
5 int mnt_writers;
6 };
7
8 struct mount {
9 struct list_head mnt_hash;
10 struct mount *mnt_parent;
11 struct dentry *mnt_mountpoint;
12 struct vfsmount mnt;
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
20 struct list_head mnt_mounts; /* list of children, anchored here */
21 struct list_head mnt_child; /* and going through their mnt_child */
22 };
23
24 static inline struct mount *real_mount(struct vfsmount *mnt)
25 {
26 return container_of(mnt, struct mount, mnt);
27 }
28
29 static inline int mnt_has_parent(struct mount *mnt)
30 {
31 return mnt != mnt->mnt_parent;
32 }
33
34 extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);