aboutsummaryrefslogtreecommitdiffstats
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)
173 173
174static struct mount *alloc_vfsmnt(const char *name) 174static struct mount *alloc_vfsmnt(const char *name)
175{ 175{
176 struct mount *p = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); 176 struct mount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
177 if (p) { 177 if (mnt) {
178 struct vfsmount *mnt = &p->mnt;
179 int err; 178 int err;
180 179
181 err = mnt_alloc_id(p); 180 err = mnt_alloc_id(mnt);
182 if (err) 181 if (err)
183 goto out_free_cache; 182 goto out_free_cache;
184 183
185 if (name) { 184 if (name) {
186 p->mnt_devname = kstrdup(name, GFP_KERNEL); 185 mnt->mnt_devname = kstrdup(name, GFP_KERNEL);
187 if (!p->mnt_devname) 186 if (!mnt->mnt_devname)
188 goto out_free_id; 187 goto out_free_id;
189 } 188 }
190 189
191#ifdef CONFIG_SMP 190#ifdef CONFIG_SMP
192 p->mnt_pcp = alloc_percpu(struct mnt_pcp); 191 mnt->mnt_pcp = alloc_percpu(struct mnt_pcp);
193 if (!p->mnt_pcp) 192 if (!mnt->mnt_pcp)
194 goto out_free_devname; 193 goto out_free_devname;
195 194
196 this_cpu_add(p->mnt_pcp->mnt_count, 1); 195 this_cpu_add(mnt->mnt_pcp->mnt_count, 1);
197#else 196#else
198 p->mnt_count = 1; 197 mnt->mnt_count = 1;
199 p->mnt_writers = 0; 198 mnt->mnt_writers = 0;
200#endif 199#endif
201 200
202 INIT_LIST_HEAD(&p->mnt_hash); 201 INIT_LIST_HEAD(&mnt->mnt_hash);
203 INIT_LIST_HEAD(&p->mnt_child); 202 INIT_LIST_HEAD(&mnt->mnt_child);
204 INIT_LIST_HEAD(&p->mnt_mounts); 203 INIT_LIST_HEAD(&mnt->mnt_mounts);
205 INIT_LIST_HEAD(&p->mnt_list); 204 INIT_LIST_HEAD(&mnt->mnt_list);
206 INIT_LIST_HEAD(&p->mnt_expire); 205 INIT_LIST_HEAD(&mnt->mnt_expire);
207 INIT_LIST_HEAD(&p->mnt_share); 206 INIT_LIST_HEAD(&mnt->mnt_share);
208 INIT_LIST_HEAD(&p->mnt_slave_list); 207 INIT_LIST_HEAD(&mnt->mnt_slave_list);
209 INIT_LIST_HEAD(&p->mnt_slave); 208 INIT_LIST_HEAD(&mnt->mnt_slave);
210#ifdef CONFIG_FSNOTIFY 209#ifdef CONFIG_FSNOTIFY
211 INIT_HLIST_HEAD(&mnt->mnt_fsnotify_marks); 210 INIT_HLIST_HEAD(&mnt->mnt_fsnotify_marks);
212#endif 211#endif
213 } 212 }
214 return p; 213 return mnt;
215 214
216#ifdef CONFIG_SMP 215#ifdef CONFIG_SMP
217out_free_devname: 216out_free_devname:
218 kfree(p->mnt_devname); 217 kfree(mnt->mnt_devname);
219#endif 218#endif
220out_free_id: 219out_free_id:
221 mnt_free_id(p); 220 mnt_free_id(mnt);
222out_free_cache: 221out_free_cache:
223 kmem_cache_free(mnt_cache, p); 222 kmem_cache_free(mnt_cache, mnt);
224 return NULL; 223 return NULL;
225} 224}
226 225