summaryrefslogtreecommitdiffstats
path: root/sys/vm/swap_pager.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/swap_pager.c')
-rw-r--r--sys/vm/swap_pager.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index faf9075..38806a1 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -142,7 +142,7 @@ static int nsw_wcount_async; /* limit write buffers / asynchronous */
static int nsw_wcount_async_max;/* assigned maximum */
static int nsw_cluster_max; /* maximum VOP I/O allowed */
-struct blist *swapblist;
+static struct blist *swapblist;
static struct swblock **swhash;
static int swhash_mask;
static int swap_async_max = 4; /* maximum in-progress async I/O's */
@@ -2666,6 +2666,22 @@ done2:
return (error);
}
+void
+swap_pager_status(int *total, int *used)
+{
+ struct swdevt *sp;
+ int i;
+
+ *total = 0;
+ *used = 0;
+ for (sp = swdevt, i = 0; i < nswdev; i++, sp++) {
+ if (sp->sw_vp == NULL)
+ continue;
+ *total += sp->sw_nblks;
+ *used += sp->sw_used;
+ }
+}
+
static int
sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS)
{
OpenPOWER on IntegriCloud