The following reply was made to PR kern/166780; it has been noted by GNATS.
From: Radim Kolar <[email protected]> To: [email protected] Cc: Subject: Re: kern/166780: patch for 10.X Date: Thu, 26 Apr 2012 17:46:17 +0200 Index: sys/vm/swap_pager.c =================================================================== --- sys/vm/swap_pager.c (revision 234696) +++ sys/vm/swap_pager.c (working copy) @@ -2692,3 +2692,20 @@ NODEV); return (0); } + + +static int +sysctl_vm_swap_free(SYSCTL_HANDLER_ARGS) { + int64_t swap_free = 0; + struct swdevt *sp; + + mtx_lock(&sw_dev_mtx); + TAILQ_FOREACH(sp, &swtailq, sw_list) { + swap_free += sp->sw_nblks - sp->sw_used; + } + mtx_unlock(&sw_dev_mtx); + swap_free *= PAGE_SIZE; + return SYSCTL_OUT(req, &swap_free, sizeof(swap_free)); +} +SYSCTL_OID(_vm, OID_AUTO, swap_free, CTLTYPE_S64|CTLFLAG_RD|CTLFLAG_MPSAFE, + NULL, 0, sysctl_vm_swap_free, "Q", "Amount of free swap storage."); _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "[email protected]"
