summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2017-08-14 19:12:51 +0000
committermckusick <mckusick@FreeBSD.org>2017-08-14 19:12:51 +0000
commit8cd48e1dec61fac4f477b17f9e6593feae67eb64 (patch)
treeac2bfa703f02036630ad7997ea1f9eff5bb3f8ae /sys/geom
parentb583cd54fcb9570feef32e0beb0c31a0f28c393c (diff)
downloadFreeBSD-src-8cd48e1dec61fac4f477b17f9e6593feae67eb64.zip
FreeBSD-src-8cd48e1dec61fac4f477b17f9e6593feae67eb64.tar.gz
MFC of 322178:
Bug 198500 reports bad sysctl values for gjournal cache limit. PR: 198500 Submitted by: Dr. Andreas Longwitz <longwitz@incore.de> Reported by: Eugene Grosbein Discussed with: kib Approved by: re (marius)
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/journal/g_journal.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c
index 2b6a0b0..aebf03f 100644
--- a/sys/geom/journal/g_journal.c
+++ b/sys/geom/journal/g_journal.c
@@ -131,28 +131,28 @@ SYSCTL_PROC(_kern_geom_journal, OID_AUTO, record_entries,
SYSCTL_UINT(_kern_geom_journal, OID_AUTO, optimize, CTLFLAG_RW,
&g_journal_do_optimize, 0, "Try to combine bios on flush and copy");
-static u_int g_journal_cache_used = 0;
-static u_int g_journal_cache_limit = 64 * 1024 * 1024;
+static u_long g_journal_cache_used = 0;
+static u_long g_journal_cache_limit = 64 * 1024 * 1024;
TUNABLE_INT("kern.geom.journal.cache.limit", &g_journal_cache_limit);
static u_int g_journal_cache_divisor = 2;
TUNABLE_INT("kern.geom.journal.cache.divisor", &g_journal_cache_divisor);
static u_int g_journal_cache_switch = 90;
static u_int g_journal_cache_misses = 0;
static u_int g_journal_cache_alloc_failures = 0;
-static u_int g_journal_cache_low = 0;
+static u_long g_journal_cache_low = 0;
static SYSCTL_NODE(_kern_geom_journal, OID_AUTO, cache, CTLFLAG_RW, 0,
"GEOM_JOURNAL cache");
-SYSCTL_UINT(_kern_geom_journal_cache, OID_AUTO, used, CTLFLAG_RD,
+SYSCTL_ULONG(_kern_geom_journal_cache, OID_AUTO, used, CTLFLAG_RD,
&g_journal_cache_used, 0, "Number of allocated bytes");
static int
g_journal_cache_limit_sysctl(SYSCTL_HANDLER_ARGS)
{
- u_int limit;
+ u_long limit;
int error;
limit = g_journal_cache_limit;
- error = sysctl_handle_int(oidp, &limit, 0, req);
+ error = sysctl_handle_long(oidp, &limit, 0, req);
if (error != 0 || req->newptr == NULL)
return (error);
g_journal_cache_limit = limit;
@@ -160,7 +160,7 @@ g_journal_cache_limit_sysctl(SYSCTL_HANDLER_ARGS)
return (0);
}
SYSCTL_PROC(_kern_geom_journal_cache, OID_AUTO, limit,
- CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, g_journal_cache_limit_sysctl, "I",
+ CTLTYPE_ULONG | CTLFLAG_RW, NULL, 0, g_journal_cache_limit_sysctl, "I",
"Maximum number of allocated bytes");
SYSCTL_UINT(_kern_geom_journal_cache, OID_AUTO, divisor, CTLFLAG_RDTUN,
&g_journal_cache_divisor, 0,
@@ -3059,9 +3059,9 @@ g_journal_switcher(void *arg)
kproc_exit(0);
}
if (error == 0 && g_journal_sync_requested == 0) {
- GJ_DEBUG(1, "Out of cache, force switch (used=%u "
- "limit=%u).", g_journal_cache_used,
- g_journal_cache_limit);
+ GJ_DEBUG(1, "Out of cache, force switch (used=%jd "
+ "limit=%jd).", (intmax_t)g_journal_cache_used,
+ (intmax_t)g_journal_cache_limit);
}
GJ_TIMER_START(1, &bt);
g_journal_do_switch(mp);
OpenPOWER on IntegriCloud