summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pstat
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-03-04 12:40:29 +0000
committerdyson <dyson@FreeBSD.org>1996-03-04 12:40:29 +0000
commitdedb21f798511324303d567dcd40050f5fd67e06 (patch)
treeef490b0d8a40a327acb2358e964cdd1ceab3de0c /usr.sbin/pstat
parent1aa838b292ec79abeb0c74a9e3cf5d256751e2bf (diff)
downloadFreeBSD-src-dedb21f798511324303d567dcd40050f5fd67e06.zip
FreeBSD-src-dedb21f798511324303d567dcd40050f5fd67e06.tar.gz
Fix pstat to sync up with recent changes with swap space allocation.
Diffstat (limited to 'usr.sbin/pstat')
-rw-r--r--usr.sbin/pstat/pstat.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index c20469c..c787fe1 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1061,13 +1061,14 @@ swapmode()
struct swdevt *sw;
long blocksize, *perdev;
struct rlist head;
- struct rlist *swaplist;
+ struct rlisthdr swaplist;
+ struct rlist *swapptr;
u_long ptr;
KGET(VM_NSWAP, nswap);
KGET(VM_NSWDEV, nswdev);
KGET(VM_DMMAX, dmmax);
- KGET(VM_SWAPLIST, swaplist);
+ KGET1(VM_SWAPLIST, &swaplist, sizeof swaplist, "swaplist");
if ((sw = malloc(nswdev * sizeof(*sw))) == NULL ||
(perdev = malloc(nswdev * sizeof(*perdev))) == NULL)
err(1, "malloc");
@@ -1077,10 +1078,11 @@ swapmode()
/* Count up swap space. */
nfree = 0;
memset(perdev, 0, nswdev * sizeof(*perdev));
- while (swaplist) {
+ swapptr = swaplist.rlh_list;
+ while (swapptr) {
int top, bottom, next_block;
- KGET2(swaplist, &head, sizeof(struct rlist), "swaplist");
+ KGET2(swapptr, &head, sizeof(struct rlist), "swapptr");
top = head.rl_end;
bottom = head.rl_start;
@@ -1108,7 +1110,7 @@ swapmode()
perdev[(bottom / dmmax) % nswdev] +=
top - bottom + 1;
- swaplist = head.rl_next;
+ swapptr = head.rl_next;
}
header = getbsize(&hlen, &blocksize);
OpenPOWER on IntegriCloud