Commit 900148dcac6bc93ca688d64a7f9a9f8d706e0d1c

Authored by Al Viro
1 parent 95bc5f25c1

vfs: spread struct mount - mntput_no_expire

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 1 changed file with 7 additions and 6 deletions Side-by-side Diff

... ... @@ -763,9 +763,8 @@
763 763 deactivate_super(sb);
764 764 }
765 765  
766   -static void mntput_no_expire(struct vfsmount *m)
  766 +static void mntput_no_expire(struct mount *mnt)
767 767 {
768   - struct mount *mnt = real_mount(m);
769 768 put_again:
770 769 #ifdef CONFIG_SMP
771 770 br_read_lock(vfsmount_lock);
... ... @@ -792,7 +791,7 @@
792 791 mnt_add_count(mnt, mnt->mnt.mnt_pinned + 1);
793 792 mnt->mnt.mnt_pinned = 0;
794 793 br_write_unlock(vfsmount_lock);
795   - acct_auto_close_mnt(m);
  794 + acct_auto_close_mnt(&mnt->mnt);
796 795 goto put_again;
797 796 }
798 797 br_write_unlock(vfsmount_lock);
... ... @@ -805,7 +804,7 @@
805 804 /* avoid cacheline pingpong, hope gcc doesn't get "smart" */
806 805 if (unlikely(mnt->mnt_expiry_mark))
807 806 mnt->mnt_expiry_mark = 0;
808   - mntput_no_expire(mnt);
  807 + mntput_no_expire(real_mount(mnt));
809 808 }
810 809 }
811 810 EXPORT_SYMBOL(mntput);
... ... @@ -1351,6 +1350,7 @@
1351 1350 SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
1352 1351 {
1353 1352 struct path path;
  1353 + struct mount *mnt;
1354 1354 int retval;
1355 1355 int lookup_flags = 0;
1356 1356  
... ... @@ -1363,6 +1363,7 @@
1363 1363 retval = user_path_at(AT_FDCWD, name, lookup_flags, &path);
1364 1364 if (retval)
1365 1365 goto out;
  1366 + mnt = real_mount(path.mnt);
1366 1367 retval = -EINVAL;
1367 1368 if (path.dentry != path.mnt->mnt_root)
1368 1369 goto dput_and_out;
1369 1370  
... ... @@ -1373,11 +1374,11 @@
1373 1374 if (!capable(CAP_SYS_ADMIN))
1374 1375 goto dput_and_out;
1375 1376  
1376   - retval = do_umount(real_mount(path.mnt), flags);
  1377 + retval = do_umount(mnt, flags);
1377 1378 dput_and_out:
1378 1379 /* we mustn't call path_put() as that would clear mnt_expiry_mark */
1379 1380 dput(path.dentry);
1380   - mntput_no_expire(path.mnt);
  1381 + mntput_no_expire(mnt);
1381 1382 out:
1382 1383 return retval;
1383 1384 }