aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-03-22 16:14:30 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-03-27 20:48:04 -0400
commit6758f953d05378d907a164c67934cd86183d9c88 (patch)
tree8697e51c495610804b3a5aad191434629d5fd09d /fs
parentc35038becad0adb0e25261fff66d85b1a6ddd0c2 (diff)
[PATCH] mnt_expire is protected by namespace_sem, no need for vfsmount_lock
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 7bd74b25930c..94f026ec990a 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -262,10 +262,8 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
262 /* stick the duplicate mount on the same expiry list 262 /* stick the duplicate mount on the same expiry list
263 * as the original if that was on one */ 263 * as the original if that was on one */
264 if (flag & CL_EXPIRE) { 264 if (flag & CL_EXPIRE) {
265 spin_lock(&vfsmount_lock);
266 if (!list_empty(&old->mnt_expire)) 265 if (!list_empty(&old->mnt_expire))
267 list_add(&mnt->mnt_expire, &old->mnt_expire); 266 list_add(&mnt->mnt_expire, &old->mnt_expire);
268 spin_unlock(&vfsmount_lock);
269 } 267 }
270 } 268 }
271 return mnt; 269 return mnt;
@@ -1127,11 +1125,9 @@ static noinline int do_move_mount(struct nameidata *nd, char *old_name)
1127 if (err) 1125 if (err)
1128 goto out1; 1126 goto out1;
1129 1127
1130 spin_lock(&vfsmount_lock);
1131 /* if the mount is moved, it should no longer be expire 1128 /* if the mount is moved, it should no longer be expire
1132 * automatically */ 1129 * automatically */
1133 list_del_init(&old_nd.path.mnt->mnt_expire); 1130 list_del_init(&old_nd.path.mnt->mnt_expire);
1134 spin_unlock(&vfsmount_lock);
1135out1: 1131out1:
1136 mutex_unlock(&nd->path.dentry->d_inode->i_mutex); 1132 mutex_unlock(&nd->path.dentry->d_inode->i_mutex);
1137out: 1133out:
@@ -1198,12 +1194,9 @@ int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
1198 if ((err = graft_tree(newmnt, nd))) 1194 if ((err = graft_tree(newmnt, nd)))
1199 goto unlock; 1195 goto unlock;
1200 1196
1201 if (fslist) { 1197 if (fslist) /* add to the specified expiration list */
1202 /* add to the specified expiration list */
1203 spin_lock(&vfsmount_lock);
1204 list_add_tail(&newmnt->mnt_expire, fslist); 1198 list_add_tail(&newmnt->mnt_expire, fslist);
1205 spin_unlock(&vfsmount_lock); 1199
1206 }
1207 up_write(&namespace_sem); 1200 up_write(&namespace_sem);
1208 return 0; 1201 return 0;
1209 1202