From: Christoph Hellwig Signed-off-by: Andrew Morton --- 25-akpm/fs/namespace.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff -puN fs/namespace.c~small-style-fixups-for-the-new-automount-code fs/namespace.c --- 25/fs/namespace.c~small-style-fixups-for-the-new-automount-code 2004-07-11 22:01:55.687955152 -0700 +++ 25-akpm/fs/namespace.c 2004-07-11 22:01:55.691954544 -0700 @@ -832,14 +832,12 @@ EXPORT_SYMBOL_GPL(do_add_mount); void mark_mounts_for_expiry(struct list_head *mounts) { struct namespace *namespace; - struct list_head graveyard, *_p, *_n; - struct vfsmount *mnt; + struct vfsmount *mnt, *next; + LIST_HEAD(graveyard); if (list_empty(mounts)) return; - INIT_LIST_HEAD(&graveyard); - spin_lock(&vfsmount_lock); /* extract from the expiration list every vfsmount that matches the @@ -848,9 +846,7 @@ void mark_mounts_for_expiry(struct list_ * - still marked for expiry (marked on the last call here; marks are * cleared by mntput()) */ - list_for_each_safe(_p, _n, mounts) { - mnt = list_entry(_p, struct vfsmount, mnt_fslink); - + list_for_each_entry_safe(mnt, next, mounts, mnt_fslink) { if (!xchg(&mnt->mnt_expiry_mark, 1) || atomic_read(&mnt->mnt_count) != 1) continue; @@ -913,8 +909,7 @@ void mark_mounts_for_expiry(struct list_ } mntput(mnt); - } - else { + } else { /* someone brought it back to life whilst we didn't * have any locks held so return it to the expiration * list */ _