aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-07-07 20:57:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:51 -0400
commita4d70278610e6bebe44a7b59a469fe7391387da6 (patch)
tree936ff611c40a3e1e3027f548e31ef312ca104fab
parent1ce88cf466f7b6078b14d67d186a3d7c19dd5609 (diff)
[PATCH] namespace.c: cleanup in mark_mounts_for_expiry()
This patch simplifies mark_mounts_for_expiry() by using detach_mnt() instead of duplicating everything it does. It should be an equivalent transformation except for righting the dput/mntput order. Al Viro said: "Looks sane". Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <viro@parcelfarce.linux.theplanet.co.uk> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/namespace.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 9d17541ebafa..ea555a36c314 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -880,24 +880,13 @@ void mark_mounts_for_expiry(struct list_head *mounts)
880 /* check that it is still dead: the count should now be 2 - as 880 /* check that it is still dead: the count should now be 2 - as
881 * contributed by the vfsmount parent and the mntget above */ 881 * contributed by the vfsmount parent and the mntget above */
882 if (atomic_read(&mnt->mnt_count) == 2) { 882 if (atomic_read(&mnt->mnt_count) == 2) {
883 struct vfsmount *xdmnt; 883 struct nameidata old_nd;
884 struct dentry *xdentry;
885 884
886 /* delete from the namespace */ 885 /* delete from the namespace */
887 list_del_init(&mnt->mnt_list); 886 list_del_init(&mnt->mnt_list);
888 list_del_init(&mnt->mnt_child); 887 detach_mnt(mnt, &old_nd);
889 list_del_init(&mnt->mnt_hash);
890 mnt->mnt_mountpoint->d_mounted--;
891
892 xdentry = mnt->mnt_mountpoint;
893 mnt->mnt_mountpoint = mnt->mnt_root;
894 xdmnt = mnt->mnt_parent;
895 mnt->mnt_parent = mnt;
896
897 spin_unlock(&vfsmount_lock); 888 spin_unlock(&vfsmount_lock);
898 889 path_release(&old_nd);
899 mntput(xdmnt);
900 dput(xdentry);
901 890
902 /* now lay it to rest if this was the last ref on the 891 /* now lay it to rest if this was the last ref on the
903 * superblock */ 892 * superblock */