summaryrefslogtreecommitdiff
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-25 02:35:16 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:57:12 -0500
commitc63181e6b6df89176b3984c6977bb5ec03d0df23 (patch)
tree2e6056a7d85e8df9dbf95e6fa4291f76a714c7c8 /fs/namespace.c
parent52ba1621de1479ce7e52b6d167860462e483313c (diff)
vfs: move fsnotify junk to struct mount
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index b8a30928d0c1..124a12555fe4 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -173,54 +173,53 @@ unsigned int mnt_get_count(struct mount *mnt)
static struct mount *alloc_vfsmnt(const char *name)
{
- struct mount *p = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
- if (p) {
- struct vfsmount *mnt = &p->mnt;
+ struct mount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
+ if (mnt) {
int err;
- err = mnt_alloc_id(p);
+ err = mnt_alloc_id(mnt);
if (err)
goto out_free_cache;
if (name) {
- p->mnt_devname = kstrdup(name, GFP_KERNEL);
- if (!p->mnt_devname)
+ mnt->mnt_devname = kstrdup(name, GFP_KERNEL);
+ if (!mnt->mnt_devname)
goto out_free_id;
}
#ifdef CONFIG_SMP
- p->mnt_pcp = alloc_percpu(struct mnt_pcp);
- if (!p->mnt_pcp)
+ mnt->mnt_pcp = alloc_percpu(struct mnt_pcp);
+ if (!mnt->mnt_pcp)
goto out_free_devname;
- this_cpu_add(p->mnt_pcp->mnt_count, 1);
+ this_cpu_add(mnt->mnt_pcp->mnt_count, 1);
#else
- p->mnt_count = 1;
- p->mnt_writers = 0;
+ mnt->mnt_count = 1;
+ mnt->mnt_writers = 0;
#endif
- INIT_LIST_HEAD(&p->mnt_hash);
- INIT_LIST_HEAD(&p->mnt_child);
- INIT_LIST_HEAD(&p->mnt_mounts);
- INIT_LIST_HEAD(&p->mnt_list);
- INIT_LIST_HEAD(&p->mnt_expire);
- INIT_LIST_HEAD(&p->mnt_share);
- INIT_LIST_HEAD(&p->mnt_slave_list);
- INIT_LIST_HEAD(&p->mnt_slave);
+ INIT_LIST_HEAD(&mnt->mnt_hash);
+ INIT_LIST_HEAD(&mnt->mnt_child);
+ INIT_LIST_HEAD(&mnt->mnt_mounts);
+ INIT_LIST_HEAD(&mnt->mnt_list);
+ INIT_LIST_HEAD(&mnt->mnt_expire);
+ INIT_LIST_HEAD(&mnt->mnt_share);
+ INIT_LIST_HEAD(&mnt->mnt_slave_list);
+ INIT_LIST_HEAD(&mnt->mnt_slave);
#ifdef CONFIG_FSNOTIFY
INIT_HLIST_HEAD(&mnt->mnt_fsnotify_marks);
#endif
}
- return p;
+ return mnt;
#ifdef CONFIG_SMP
out_free_devname:
- kfree(p->mnt_devname);
+ kfree(mnt->mnt_devname);
#endif
out_free_id:
- mnt_free_id(p);
+ mnt_free_id(mnt);
out_free_cache:
- kmem_cache_free(mnt_cache, p);
+ kmem_cache_free(mnt_cache, mnt);
return NULL;
}