From 0e5954cfb831d5fa4f0fe2ad9a064cf7bdb45b83 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Fri, 16 Mar 2001 16:05:29 +0000 Subject: Use CIRCLEQ macros for mountlist. --- sys/kern/vfs_subr.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 9b9605843e0..d338945579d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.54 2001/03/16 15:51:04 art Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.55 2001/03/16 16:05:28 art Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -300,7 +300,7 @@ vfs_getnewfsid(mp) ++xxxfs_mntid; tfsid.val[0] = makedev(nblkdev + mtype, xxxfs_mntid); tfsid.val[1] = mtype; - if (mountlist.cqh_first != (void *)&mountlist) { + if (!CIRCLEQ_EMPTY(&mountlist)) { while (vfs_getvfs(&tfsid)) { tfsid.val[0]++; xxxfs_mntid++; @@ -1321,7 +1321,7 @@ printlockedvnodes() printf("Locked vnodes\n"); simple_lock(&mountlist_slock); - for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist; + for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); @@ -1416,9 +1416,10 @@ sysctl_vnode(where, sizep, p) ewhere = where + *sizep; simple_lock(&mountlist_slock); - for (mp = mountlist.cqh_first; mp != (void *)&mountlist; mp = nmp) { + for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); + mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = mp->mnt_list.cqe_next; + nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } savebp = bp; @@ -1453,7 +1454,7 @@ again: simple_unlock(&mntvnode_slock); simple_lock(&mountlist_slock); - nmp = mp->mnt_list.cqe_next; + nmp = CIRCLEQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } @@ -1719,9 +1720,10 @@ vfs_unmountall() int allerror, error, again = 1; retry: - for (allerror = 0, - mp = mountlist.cqh_last; mp != (void *)&mountlist; mp = nmp) { - nmp = mp->mnt_list.cqe_prev; + allerror = 0; + for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); + mp = nmp) { + nmp = CIRCLEQ_PREV(mp, mnt_list); if ((error = dounmount(mp, MNT_FORCE, curproc)) != 0) { printf("unmount of %s failed with error %d\n", mp->mnt_stat.f_mntonname, error); -- cgit v1.2.3