aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-25 00:33:11 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:57:09 -0500
commit900148dcac6bc93ca688d64a7f9a9f8d706e0d1c (patch)
tree69077133e37e105fc88873429f33469c67a840c6 /fs/namespace.c
parent95bc5f25c10fcdf02c53af1eda987f58d0bc377c (diff)
vfs: spread struct mount - mntput_no_expire
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 6b5e0436acfd..3e95cc26dda6 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -763,9 +763,8 @@ static inline void mntfree(struct mount *mnt)
763 deactivate_super(sb); 763 deactivate_super(sb);
764} 764}
765 765
766static void mntput_no_expire(struct vfsmount *m) 766static void mntput_no_expire(struct mount *mnt)
767{ 767{
768 struct mount *mnt = real_mount(m);
769put_again: 768put_again:
770#ifdef CONFIG_SMP 769#ifdef CONFIG_SMP
771 br_read_lock(vfsmount_lock); 770 br_read_lock(vfsmount_lock);
@@ -792,7 +791,7 @@ put_again:
792 mnt_add_count(mnt, mnt->mnt.mnt_pinned + 1); 791 mnt_add_count(mnt, mnt->mnt.mnt_pinned + 1);
793 mnt->mnt.mnt_pinned = 0; 792 mnt->mnt.mnt_pinned = 0;
794 br_write_unlock(vfsmount_lock); 793 br_write_unlock(vfsmount_lock);
795 acct_auto_close_mnt(m); 794 acct_auto_close_mnt(&mnt->mnt);
796 goto put_again; 795 goto put_again;
797 } 796 }
798 br_write_unlock(vfsmount_lock); 797 br_write_unlock(vfsmount_lock);
@@ -805,7 +804,7 @@ void mntput(struct vfsmount *mnt)
805 /* avoid cacheline pingpong, hope gcc doesn't get "smart" */ 804 /* avoid cacheline pingpong, hope gcc doesn't get "smart" */
806 if (unlikely(mnt->mnt_expiry_mark)) 805 if (unlikely(mnt->mnt_expiry_mark))
807 mnt->mnt_expiry_mark = 0; 806 mnt->mnt_expiry_mark = 0;
808 mntput_no_expire(mnt); 807 mntput_no_expire(real_mount(mnt));
809 } 808 }
810} 809}
811EXPORT_SYMBOL(mntput); 810EXPORT_SYMBOL(mntput);
@@ -1351,6 +1350,7 @@ static int do_umount(struct mount *mnt, int flags)
1351SYSCALL_DEFINE2(umount, char __user *, name, int, flags) 1350SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
1352{ 1351{
1353 struct path path; 1352 struct path path;
1353 struct mount *mnt;
1354 int retval; 1354 int retval;
1355 int lookup_flags = 0; 1355 int lookup_flags = 0;
1356 1356
@@ -1363,6 +1363,7 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
1363 retval = user_path_at(AT_FDCWD, name, lookup_flags, &path); 1363 retval = user_path_at(AT_FDCWD, name, lookup_flags, &path);
1364 if (retval) 1364 if (retval)
1365 goto out; 1365 goto out;
1366 mnt = real_mount(path.mnt);
1366 retval = -EINVAL; 1367 retval = -EINVAL;
1367 if (path.dentry != path.mnt->mnt_root) 1368 if (path.dentry != path.mnt->mnt_root)
1368 goto dput_and_out; 1369 goto dput_and_out;
@@ -1373,11 +1374,11 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
1373 if (!capable(CAP_SYS_ADMIN)) 1374 if (!capable(CAP_SYS_ADMIN))
1374 goto dput_and_out; 1375 goto dput_and_out;
1375 1376
1376 retval = do_umount(real_mount(path.mnt), flags); 1377 retval = do_umount(mnt, flags);
1377dput_and_out: 1378dput_and_out:
1378 /* we mustn't call path_put() as that would clear mnt_expiry_mark */ 1379 /* we mustn't call path_put() as that would clear mnt_expiry_mark */
1379 dput(path.dentry); 1380 dput(path.dentry);
1380 mntput_no_expire(path.mnt); 1381 mntput_no_expire(mnt);
1381out: 1382out:
1382 return retval; 1383 return retval;
1383} 1384}