diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-06-29 12:58:42 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-07-04 18:58:38 -0400 |
commit | e4e59906cfe4e215a4360962bedb3d6e5cca5158 (patch) | |
tree | 3d53d532690556be1abc6f024b8752617d989ea8 | |
parent | adc9b5c09129fd8df17d83ca9a5b0532632a1b77 (diff) |
fs/namespace.c: shift put_mountpoint() to callers of unhash_mnt()
make unhash_mnt() return the mountpoint to be dropped, let callers
deal with it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namespace.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 746e3fd1f430..b7059a4f07e3 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -795,15 +795,17 @@ static void __touch_mnt_namespace(struct mnt_namespace *ns) | |||
795 | /* | 795 | /* |
796 | * vfsmount lock must be held for write | 796 | * vfsmount lock must be held for write |
797 | */ | 797 | */ |
798 | static void unhash_mnt(struct mount *mnt) | 798 | static struct mountpoint *unhash_mnt(struct mount *mnt) |
799 | { | 799 | { |
800 | struct mountpoint *mp; | ||
800 | mnt->mnt_parent = mnt; | 801 | mnt->mnt_parent = mnt; |
801 | mnt->mnt_mountpoint = mnt->mnt.mnt_root; | 802 | mnt->mnt_mountpoint = mnt->mnt.mnt_root; |
802 | list_del_init(&mnt->mnt_child); | 803 | list_del_init(&mnt->mnt_child); |
803 | hlist_del_init_rcu(&mnt->mnt_hash); | 804 | hlist_del_init_rcu(&mnt->mnt_hash); |
804 | hlist_del_init(&mnt->mnt_mp_list); | 805 | hlist_del_init(&mnt->mnt_mp_list); |
805 | put_mountpoint(mnt->mnt_mp); | 806 | mp = mnt->mnt_mp; |
806 | mnt->mnt_mp = NULL; | 807 | mnt->mnt_mp = NULL; |
808 | return mp; | ||
807 | } | 809 | } |
808 | 810 | ||
809 | /* | 811 | /* |
@@ -813,7 +815,7 @@ static void detach_mnt(struct mount *mnt, struct path *old_path) | |||
813 | { | 815 | { |
814 | old_path->dentry = mnt->mnt_mountpoint; | 816 | old_path->dentry = mnt->mnt_mountpoint; |
815 | old_path->mnt = &mnt->mnt_parent->mnt; | 817 | old_path->mnt = &mnt->mnt_parent->mnt; |
816 | unhash_mnt(mnt); | 818 | put_mountpoint(unhash_mnt(mnt)); |
817 | } | 819 | } |
818 | 820 | ||
819 | /* | 821 | /* |
@@ -823,7 +825,7 @@ static void umount_mnt(struct mount *mnt) | |||
823 | { | 825 | { |
824 | /* old mountpoint will be dropped when we can do that */ | 826 | /* old mountpoint will be dropped when we can do that */ |
825 | mnt->mnt_ex_mountpoint = mnt->mnt_mountpoint; | 827 | mnt->mnt_ex_mountpoint = mnt->mnt_mountpoint; |
826 | unhash_mnt(mnt); | 828 | put_mountpoint(unhash_mnt(mnt)); |
827 | } | 829 | } |
828 | 830 | ||
829 | /* | 831 | /* |