patch-2.4.6 linux/fs/autofs4/expire.c

Next file: linux/fs/binfmt_elf.c
Previous file: linux/fs/autofs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/fs/autofs4/expire.c linux/fs/autofs4/expire.c
@@ -66,19 +66,11 @@
    non-busy mounts */
 static int check_vfsmnt(struct vfsmount *mnt, struct dentry *dentry)
 {
-	int ret = 0;
-	struct list_head *tmp;
-
-	list_for_each(tmp, &dentry->d_vfsmnt) {
-		struct vfsmount *vfs = list_entry(tmp, struct vfsmount, 
-						  mnt_clash);
-		DPRINTK(("check_vfsmnt: mnt=%p, dentry=%p, tmp=%p, vfs=%p\n",
-			 mnt, dentry, tmp, vfs));
-		if (vfs->mnt_parent != mnt || /* don't care about busy-ness of other namespaces */
-		    !is_vfsmnt_tree_busy(vfs))
-			ret++;
-	}
+	int ret = dentry->d_mounted;
+	struct vfsmount *vfs = lookup_mnt(mnt, dentry);
 
+	if (vfs && is_vfsmnt_tree_busy(vfs))
+		ret--;
 	DPRINTK(("check_vfsmnt: ret=%d\n", ret));
 	return ret;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)