git: 567378cc0796 - main - Fix OID format for `vm.swap_reserved` and `vm.swap_total`
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Apr 2022 02:07:36 UTC
The branch main has been updated by ngie:
URL: https://cgit.FreeBSD.org/src/commit/?id=567378cc0796c12f5d4bac79e639e22adf42b12f
commit 567378cc0796c12f5d4bac79e639e22adf42b12f
Author: Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2022-04-11 01:17:09 +0000
Commit: Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2022-04-11 01:17:09 +0000
Fix OID format for `vm.swap_reserved` and `vm.swap_total`
The correct OID format for CTLTYPE_U64 is `QU` (`uquad_t`), not `A`
(text expressed via `char *`).
This issue was noticed while doing an sysctl tree walk using a
sysctl(9) consumer that relies on the OID format to intuit what the
type should be for a given sysctl.
MFC after: 1 month
Sponsored by: DellEMC Isilon
Differential Revision: https://reviews.freebsd.org/D34877
---
sys/vm/swap_pager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 515b758fc244..ef126ee5fdf3 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -163,10 +163,10 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, swap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
"VM swap stats");
SYSCTL_PROC(_vm, OID_AUTO, swap_reserved, CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
- &swap_reserved, 0, sysctl_page_shift, "A",
+ &swap_reserved, 0, sysctl_page_shift, "QU",
"Amount of swap storage needed to back all allocated anonymous memory.");
SYSCTL_PROC(_vm, OID_AUTO, swap_total, CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
- &swap_total, 0, sysctl_page_shift, "A",
+ &swap_total, 0, sysctl_page_shift, "QU",
"Total amount of available swap storage.");
static int overcommit = 0;