diff options
author | dt <dt@FreeBSD.org> | 1998-09-11 14:38:12 +0000 |
---|---|---|
committer | dt <dt@FreeBSD.org> | 1998-09-11 14:38:12 +0000 |
commit | 413082054c2eceefc9dc96eb24269e320e8b4c38 (patch) | |
tree | 1c2bba455c2689bb56e40f87460ace65ee6a787c /usr.bin/top | |
parent | 9993c373dcfff7dabeaa10cb867f7bcb83a0f7cf (diff) | |
download | FreeBSD-src-413082054c2eceefc9dc96eb24269e320e8b4c38.zip FreeBSD-src-413082054c2eceefc9dc96eb24269e320e8b4c38.tar.gz |
Some fixes for swap space accounting.
Obtained from: pstat.c
Diffstat (limited to 'usr.bin/top')
-rw-r--r-- | usr.bin/top/machine.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index e5edd40..b0845e6 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -19,7 +19,7 @@ * Steven Wallace <swallace@freebsd.org> * Wolfram Schneider <wosch@FreeBSD.org> * - * $Id: machine.c,v 1.13 1998/08/04 14:10:30 des Exp $ + * $Id: machine.c,v 1.14 1998/08/12 09:58:15 wosch Exp $ */ @@ -1084,8 +1084,13 @@ swapmode(retavail, retfree) * Don't report statistics for partitions which have not * yet been activated via swapon(8). */ + if (!(sw[i].sw_flags & SW_FREED)) + continue; - xsize = sw[i].sw_nblks; + /* The first dmmax is never allocated to avoid trashing of + * disklabels + */ + xsize = sw[i].sw_nblks - dmmax; xfree = perdev[i]; used = xsize - xfree; npfree++; |