From 657cc8e6053a5605c8440b4ebabb4f592d061393 Mon Sep 17 00:00:00 2001 From: dg Date: Fri, 11 Aug 1995 23:40:31 +0000 Subject: Do the mountlist traversal the way it was done in 4.4-Lite2. --- usr.sbin/pstat/pstat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/pstat/pstat.c') diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index 597c385..cfff165 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -727,9 +727,7 @@ kinfo_vnodes(avnodes) bp = vbuf; evbuf = vbuf + (numvnodes + 20) * (VPTRSZ + VNODESZ); KGET(V_MOUNTLIST, mountlist); - for (num = 0, mp = mountlist.cqh_first; - mp != NULL && !(num && mp == mountlist.cqh_first); - mp = mp->mnt_list.cqe_next) { + for (num = 0, mp = mountlist.cqh_first; ; mp = mp->mnt_list.cqe_next) { KGET2(mp, &mount, sizeof(mount), "mount entry"); for (vp = mount.mnt_vnodelist.lh_first; vp != NULL; vp = vp->v_mntvnodes.le_next) { @@ -743,6 +741,8 @@ kinfo_vnodes(avnodes) bp += VNODESZ; num++; } + if (mp == mountlist.cqh_last) + break; } *avnodes = num; return ((struct e_vnode *)vbuf); -- cgit v1.1