mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 11:02:44 +00:00
Some fixes for swap space accounting.
Obtained from: pstat.c
This commit is contained in:
parent
74632b447e
commit
00e500a2e5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39075
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user