diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-28 12:41:25 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-10-24 23:34:56 -0400 |
commit | 649a795affac8507657a72e761ce987d6967016b (patch) | |
tree | c6b95fb6ebc5b6ec85e898f08af93094ce58527f /fs | |
parent | 6339dab869e07a81abd22970696dde6febee094a (diff) |
fold mntfree() into mntput_no_expire()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namespace.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 3ee6e59ead55..691cd7c83275 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -872,28 +872,6 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root, | |||
872 | return ERR_PTR(err); | 872 | return ERR_PTR(err); |
873 | } | 873 | } |
874 | 874 | ||
875 | static inline void mntfree(struct mount *mnt) | ||
876 | { | ||
877 | struct vfsmount *m = &mnt->mnt; | ||
878 | struct super_block *sb = m->mnt_sb; | ||
879 | |||
880 | /* | ||
881 | * This probably indicates that somebody messed | ||
882 | * up a mnt_want/drop_write() pair. If this | ||
883 | * happens, the filesystem was probably unable | ||
884 | * to make r/w->r/o transitions. | ||
885 | */ | ||
886 | /* | ||
887 | * The locking used to deal with mnt_count decrement provides barriers, | ||
888 | * so mnt_get_writers() below is safe. | ||
889 | */ | ||
890 | WARN_ON(mnt_get_writers(mnt)); | ||
891 | fsnotify_vfsmount_delete(m); | ||
892 | dput(m->mnt_root); | ||
893 | free_vfsmnt(mnt); | ||
894 | deactivate_super(sb); | ||
895 | } | ||
896 | |||
897 | static void mntput_no_expire(struct mount *mnt) | 875 | static void mntput_no_expire(struct mount *mnt) |
898 | { | 876 | { |
899 | put_again: | 877 | put_again: |
@@ -929,7 +907,22 @@ put_again: | |||
929 | 907 | ||
930 | list_del(&mnt->mnt_instance); | 908 | list_del(&mnt->mnt_instance); |
931 | br_write_unlock(&vfsmount_lock); | 909 | br_write_unlock(&vfsmount_lock); |
932 | mntfree(mnt); | 910 | |
911 | /* | ||
912 | * This probably indicates that somebody messed | ||
913 | * up a mnt_want/drop_write() pair. If this | ||
914 | * happens, the filesystem was probably unable | ||
915 | * to make r/w->r/o transitions. | ||
916 | */ | ||
917 | /* | ||
918 | * The locking used to deal with mnt_count decrement provides barriers, | ||
919 | * so mnt_get_writers() below is safe. | ||
920 | */ | ||
921 | WARN_ON(mnt_get_writers(mnt)); | ||
922 | fsnotify_vfsmount_delete(&mnt->mnt); | ||
923 | dput(mnt->mnt.mnt_root); | ||
924 | deactivate_super(mnt->mnt.mnt_sb); | ||
925 | free_vfsmnt(mnt); | ||
933 | } | 926 | } |
934 | 927 | ||
935 | void mntput(struct vfsmount *mnt) | 928 | void mntput(struct vfsmount *mnt) |