From 7d6fec45a5131918b51dcd76da52f2ec86a85be6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 23 Nov 2011 12:14:10 -0500 Subject: vfs: start hiding vfsmount guts series Almost all fields of struct vfsmount are used only by core VFS (and a fairly small part of it, at that). The plan: embed struct vfsmount into struct mount, making the latter visible only to core parts of VFS. Then move fields from vfsmount to mount, eventually leaving only mnt_root/mnt_sb/mnt_flags in struct vfsmount. Filesystem code still gets pointers to struct vfsmount and remains unchanged; all such pointers go to struct vfsmount embedded into the instances of struct mount allocated by fs/namespace.c. When fs/namespace.c et.al. get a pointer to vfsmount, they turn it into pointer to mount (using container_of) and work with that. This is the first part of series; struct mount is introduced, allocation switched to using it. Signed-off-by: Al Viro --- fs/mount.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fs/mount.h') diff --git a/fs/mount.h b/fs/mount.h index 7890e49f74ef..47da8163e1f4 100644 --- a/fs/mount.h +++ b/fs/mount.h @@ -1,5 +1,14 @@ #include +struct mount { + struct vfsmount mnt; +}; + +static inline struct mount *real_mount(struct vfsmount *mnt) +{ + return container_of(mnt, struct mount, mnt); +} + static inline int mnt_has_parent(struct vfsmount *mnt) { return mnt != mnt->mnt_parent; -- cgit v1.2.3-55-g7522