summaryrefslogtreecommitdiff
path: root/sys/miscfs/union/union_vfsops.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-11-21 22:23:15 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-11-21 22:23:15 +0000
commitbaaeb2e9ba83449a40f23f0f9d8080cc55041de6 (patch)
tree5bb8f1bd36f3bde09e90c51ad769e5d8760eb7f6 /sys/miscfs/union/union_vfsops.c
parent144bc465b025ef0cc21a0729708acf1b1a37ae54 (diff)
Use vfs_mount_foreach_vnode
Diffstat (limited to 'sys/miscfs/union/union_vfsops.c')
-rw-r--r--sys/miscfs/union/union_vfsops.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/miscfs/union/union_vfsops.c b/sys/miscfs/union/union_vfsops.c
index 595abfa24dc..6bfadd41c19 100644
--- a/sys/miscfs/union/union_vfsops.c
+++ b/sys/miscfs/union/union_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: union_vfsops.c,v 1.11 2001/02/20 01:50:11 assar Exp $ */
+/* $OpenBSD: union_vfsops.c,v 1.12 2001/11/21 22:23:14 csapuntz Exp $ */
/* $NetBSD: union_vfsops.c,v 1.10 1995/06/18 14:47:47 cgd Exp $ */
/*
@@ -273,6 +273,18 @@ union_start(mp, flags, p)
return (0);
}
+
+int union_unmount_count_vnode(struct vnode *vp, void *args);
+
+int
+union_unmount_count_vnode(struct vnode *vp, void *args) {
+ int *n = args;
+
+ *n = *n + 1;
+ simple_unlock(&vp->v_interlock);
+ return (0);
+}
+
/*
* Free reference to union layer
*/
@@ -309,14 +321,10 @@ union_unmount(mp, mntflags, p)
* in the filesystem.
*/
for (freeing = 0; vflush(mp, um_rootvp, flags) != 0;) {
- struct vnode *vp;
int n;
/* count #vnodes held on mount list */
- for (n = 0, vp = mp->mnt_vnodelist.lh_first;
- vp != NULLVP;
- vp = vp->v_mntvnodes.le_next)
- n++;
+ vfs_mount_foreach_vnode(mp, union_unmount_count_vnode, &n);
/* if this is unchanged then stop */
if (n == freeing)