summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pstat/pstat.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-08-11 23:40:31 +0000
committerdg <dg@FreeBSD.org>1995-08-11 23:40:31 +0000
commit657cc8e6053a5605c8440b4ebabb4f592d061393 (patch)
tree41eea994fb016cad7ce47c1c823b5670b6e3a70d /usr.sbin/pstat/pstat.c
parent4c75091b0cfb2be2b7768463acdb8f9847db70bd (diff)
downloadFreeBSD-src-657cc8e6053a5605c8440b4ebabb4f592d061393.zip
FreeBSD-src-657cc8e6053a5605c8440b4ebabb4f592d061393.tar.gz
Do the mountlist traversal the way it was done in 4.4-Lite2.
Diffstat (limited to 'usr.sbin/pstat/pstat.c')
-rw-r--r--usr.sbin/pstat/pstat.c6
1 files changed, 3 insertions, 3 deletions
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);
OpenPOWER on IntegriCloud