summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pstat
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-05-14 03:37:40 +0000
committerphk <phk@FreeBSD.org>1995-05-14 03:37:40 +0000
commitd8f95d425228ddc1787fc50431bffd26c6b4a884 (patch)
tree859f81233ac6010f8869fb52e6f98cc92dc16739 /usr.sbin/pstat
parentcad5d541a0235437f78eaf82d0e8b9b7cb3ded56 (diff)
downloadFreeBSD-src-d8f95d425228ddc1787fc50431bffd26c6b4a884.zip
FreeBSD-src-d8f95d425228ddc1787fc50431bffd26c6b4a884.tar.gz
Reflect the fact that we do not swap on the first <dmmax> blocks of a
swapdev, to protect disklabels and other such magic stuff.
Diffstat (limited to 'usr.sbin/pstat')
-rw-r--r--usr.sbin/pstat/pstat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index 0b67c38..af0b4b3 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1084,7 +1084,10 @@ swapmode()
devname(sw[i].sw_dev, S_IFBLK),
hlen, sw[i].sw_nblks / div);
- 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++;
OpenPOWER on IntegriCloud