summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2014-06-27 22:05:21 +0000
committergjb <gjb@FreeBSD.org>2014-06-27 22:05:21 +0000
commitfc21f40567ac7485e9e987cf5a539bd0d11c7155 (patch)
treefce5301b062a855bc68b9cb76c6b5966c5a2acbe /sys/geom
parent2f456747e010bfa5a9dd3498aa5650e0ade39f22 (diff)
downloadFreeBSD-src-fc21f40567ac7485e9e987cf5a539bd0d11c7155.zip
FreeBSD-src-fc21f40567ac7485e9e987cf5a539bd0d11c7155.tar.gz
Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/concat/g_concat.c3
-rw-r--r--sys/geom/eli/g_eli.c18
-rw-r--r--sys/geom/eli/g_eli_key_cache.c1
-rw-r--r--sys/geom/gate/g_gate.c4
-rw-r--r--sys/geom/geom_disk.c5
-rw-r--r--sys/geom/geom_kern.c3
-rw-r--r--sys/geom/journal/g_journal.c7
-rw-r--r--sys/geom/label/g_label.c3
-rw-r--r--sys/geom/label/g_label.h4
-rw-r--r--sys/geom/linux_lvm/g_linux_lvm.c3
-rw-r--r--sys/geom/mirror/g_mirror.c14
-rw-r--r--sys/geom/part/g_part.c3
-rw-r--r--sys/geom/part/g_part_ldm.c6
-rw-r--r--sys/geom/raid/g_raid.c31
-rw-r--r--sys/geom/raid/g_raid.h12
-rw-r--r--sys/geom/raid/tr_raid1.c16
-rw-r--r--sys/geom/raid/tr_raid1e.c16
-rw-r--r--sys/geom/raid3/g_raid3.c24
-rw-r--r--sys/geom/shsec/g_shsec.c6
-rw-r--r--sys/geom/stripe/g_stripe.c9
-rw-r--r--sys/geom/vinum/geom_vinum.c3
-rw-r--r--sys/geom/virstor/g_virstor.c10
22 files changed, 141 insertions, 60 deletions
diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c
index 4627ff9..2efc1b5 100644
--- a/sys/geom/concat/g_concat.c
+++ b/sys/geom/concat/g_concat.c
@@ -48,7 +48,8 @@ SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, concat, CTLFLAG_RW, 0,
"GEOM_CONCAT stuff");
static u_int g_concat_debug = 0;
-SYSCTL_UINT(_kern_geom_concat, OID_AUTO, debug, CTLFLAG_RWTUN, &g_concat_debug, 0,
+TUNABLE_INT("kern.geom.concat.debug", &g_concat_debug);
+SYSCTL_UINT(_kern_geom_concat, OID_AUTO, debug, CTLFLAG_RW, &g_concat_debug, 0,
"Debug level");
static int g_concat_destroy(struct g_concat_softc *sc, boolean_t force);
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 2c4dc2c..d1f3cd2 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -63,23 +63,29 @@ static int g_eli_version = G_ELI_VERSION;
SYSCTL_INT(_kern_geom_eli, OID_AUTO, version, CTLFLAG_RD, &g_eli_version, 0,
"GELI version");
int g_eli_debug = 0;
-SYSCTL_INT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RWTUN, &g_eli_debug, 0,
+TUNABLE_INT("kern.geom.eli.debug", &g_eli_debug);
+SYSCTL_INT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RW, &g_eli_debug, 0,
"Debug level");
static u_int g_eli_tries = 3;
-SYSCTL_UINT(_kern_geom_eli, OID_AUTO, tries, CTLFLAG_RWTUN, &g_eli_tries, 0,
+TUNABLE_INT("kern.geom.eli.tries", &g_eli_tries);
+SYSCTL_UINT(_kern_geom_eli, OID_AUTO, tries, CTLFLAG_RW, &g_eli_tries, 0,
"Number of tries for entering the passphrase");
static u_int g_eli_visible_passphrase = GETS_NOECHO;
-SYSCTL_UINT(_kern_geom_eli, OID_AUTO, visible_passphrase, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.eli.visible_passphrase", &g_eli_visible_passphrase);
+SYSCTL_UINT(_kern_geom_eli, OID_AUTO, visible_passphrase, CTLFLAG_RW,
&g_eli_visible_passphrase, 0,
"Visibility of passphrase prompt (0 = invisible, 1 = visible, 2 = asterisk)");
u_int g_eli_overwrites = G_ELI_OVERWRITES;
-SYSCTL_UINT(_kern_geom_eli, OID_AUTO, overwrites, CTLFLAG_RWTUN, &g_eli_overwrites,
+TUNABLE_INT("kern.geom.eli.overwrites", &g_eli_overwrites);
+SYSCTL_UINT(_kern_geom_eli, OID_AUTO, overwrites, CTLFLAG_RW, &g_eli_overwrites,
0, "Number of times on-disk keys should be overwritten when destroying them");
static u_int g_eli_threads = 0;
-SYSCTL_UINT(_kern_geom_eli, OID_AUTO, threads, CTLFLAG_RWTUN, &g_eli_threads, 0,
+TUNABLE_INT("kern.geom.eli.threads", &g_eli_threads);
+SYSCTL_UINT(_kern_geom_eli, OID_AUTO, threads, CTLFLAG_RW, &g_eli_threads, 0,
"Number of threads doing crypto work");
u_int g_eli_batch = 0;
-SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RWTUN, &g_eli_batch, 0,
+TUNABLE_INT("kern.geom.eli.batch", &g_eli_batch);
+SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RW, &g_eli_batch, 0,
"Use crypto operations batching");
static eventhandler_tag g_eli_pre_sync = NULL;
diff --git a/sys/geom/eli/g_eli_key_cache.c b/sys/geom/eli/g_eli_key_cache.c
index cb86716..9530495 100644
--- a/sys/geom/eli/g_eli_key_cache.c
+++ b/sys/geom/eli/g_eli_key_cache.c
@@ -47,6 +47,7 @@ SYSCTL_DECL(_kern_geom_eli);
* provider with 512 bytes sectors and will take around 1MB of memory.
*/
static u_int g_eli_key_cache_limit = 8192;
+TUNABLE_INT("kern.geom.eli.key_cache_limit", &g_eli_key_cache_limit);
SYSCTL_UINT(_kern_geom_eli, OID_AUTO, key_cache_limit, CTLFLAG_RDTUN,
&g_eli_key_cache_limit, 0, "Maximum number of encryption keys to cache");
static uint64_t g_eli_key_cache_hits;
diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c
index ae0d7b0..eed4abb 100644
--- a/sys/geom/gate/g_gate.c
+++ b/sys/geom/gate/g_gate.c
@@ -62,9 +62,11 @@ SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, gate, CTLFLAG_RW, 0,
"GEOM_GATE configuration");
static int g_gate_debug = 0;
-SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RWTUN, &g_gate_debug, 0,
+TUNABLE_INT("kern.geom.gate.debug", &g_gate_debug);
+SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RW, &g_gate_debug, 0,
"Debug level");
static u_int g_gate_maxunits = 256;
+TUNABLE_INT("kern.geom.gate.maxunits", &g_gate_maxunits);
SYSCTL_UINT(_kern_geom_gate, OID_AUTO, maxunits, CTLFLAG_RDTUN,
&g_gate_maxunits, 0, "Maximum number of ggate devices");
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 5cfdaf0..eb72597 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -561,9 +561,12 @@ g_disk_create(void *arg, int flag)
SYSCTL_STATIC_CHILDREN(_kern_geom_disk), OID_AUTO, gp->name,
CTLFLAG_RD, 0, tmpstr);
if (sc->sysctl_tree != NULL) {
+ snprintf(tmpstr, sizeof(tmpstr),
+ "kern.geom.disk.%s.led", gp->name);
+ TUNABLE_STR_FETCH(tmpstr, sc->led, sizeof(sc->led));
SYSCTL_ADD_STRING(&sc->sysctl_ctx,
SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "led",
- CTLFLAG_RWTUN, sc->led, sizeof(sc->led),
+ CTLFLAG_RW | CTLFLAG_TUN, sc->led, sizeof(sc->led),
"LED name");
}
pp->private = sc;
diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c
index 3559daf..79afb14 100644
--- a/sys/geom/geom_kern.c
+++ b/sys/geom/geom_kern.c
@@ -212,7 +212,8 @@ SYSCTL_PROC(_kern_geom, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RD,
0, 0, sysctl_kern_geom_conftxt, "",
"Dump the GEOM config in txt");
-SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.debugflags", &g_debugflags);
+SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RW,
&g_debugflags, 0, "Set various trace levels for GEOM debugging");
SYSCTL_INT(_kern_geom, OID_AUTO, notaste, CTLFLAG_RW,
diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c
index 52dbc36..3908478 100644
--- a/sys/geom/journal/g_journal.c
+++ b/sys/geom/journal/g_journal.c
@@ -84,6 +84,7 @@ const struct g_journal_desc *g_journal_filesystems[] = {
SYSCTL_DECL(_kern_geom);
int g_journal_debug = 0;
+TUNABLE_INT("kern.geom.journal.debug", &g_journal_debug);
static u_int g_journal_switch_time = 10;
static u_int g_journal_force_switch = 70;
static u_int g_journal_parallel_flushes = 16;
@@ -94,7 +95,7 @@ static u_int g_journal_do_optimize = 1;
static SYSCTL_NODE(_kern_geom, OID_AUTO, journal, CTLFLAG_RW, 0,
"GEOM_JOURNAL stuff");
-SYSCTL_INT(_kern_geom_journal, OID_AUTO, debug, CTLFLAG_RWTUN, &g_journal_debug, 0,
+SYSCTL_INT(_kern_geom_journal, OID_AUTO, debug, CTLFLAG_RW, &g_journal_debug, 0,
"Debug level");
SYSCTL_UINT(_kern_geom_journal, OID_AUTO, switch_time, CTLFLAG_RW,
&g_journal_switch_time, 0, "Switch journals every N seconds");
@@ -132,7 +133,9 @@ SYSCTL_UINT(_kern_geom_journal, OID_AUTO, optimize, CTLFLAG_RW,
static u_int g_journal_cache_used = 0;
static u_int 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;
@@ -157,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_RWTUN, NULL, 0, g_journal_cache_limit_sysctl, "I",
+ CTLTYPE_UINT | 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,
diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c
index 36498e1..ce1376e 100644
--- a/sys/geom/label/g_label.c
+++ b/sys/geom/label/g_label.c
@@ -50,7 +50,8 @@ FEATURE(geom_label, "GEOM labeling support");
SYSCTL_DECL(_kern_geom);
SYSCTL_NODE(_kern_geom, OID_AUTO, label, CTLFLAG_RW, 0, "GEOM_LABEL stuff");
u_int g_label_debug = 0;
-SYSCTL_UINT(_kern_geom_label, OID_AUTO, debug, CTLFLAG_RWTUN, &g_label_debug, 0,
+TUNABLE_INT("kern.geom.label.debug", &g_label_debug);
+SYSCTL_UINT(_kern_geom_label, OID_AUTO, debug, CTLFLAG_RW, &g_label_debug, 0,
"Debug level");
static int g_label_destroy_geom(struct gctl_req *req, struct g_class *mp,
diff --git a/sys/geom/label/g_label.h b/sys/geom/label/g_label.h
index 66b762c..eca3126 100644
--- a/sys/geom/label/g_label.h
+++ b/sys/geom/label/g_label.h
@@ -65,7 +65,9 @@ SYSCTL_DECL(_kern_geom_label);
SYSCTL_NODE(_kern_geom_label, OID_AUTO, kind, CTLFLAG_RD, \
NULL, ""); \
SYSCTL_INT(_kern_geom_label_##kind, OID_AUTO, enable, \
- CTLFLAG_RWTUN, &label.ld_enabled, 1, descr)
+ CTLFLAG_RW, &label.ld_enabled, 1, descr); \
+ TUNABLE_INT("kern.geom.label." __XSTRING(kind) ".enable", \
+ &label.ld_enabled)
typedef void g_label_taste_t (struct g_consumer *cp, char *label, size_t size);
diff --git a/sys/geom/linux_lvm/g_linux_lvm.c b/sys/geom/linux_lvm/g_linux_lvm.c
index bf2f1e7..2ac19e0 100644
--- a/sys/geom/linux_lvm/g_linux_lvm.c
+++ b/sys/geom/linux_lvm/g_linux_lvm.c
@@ -79,7 +79,8 @@ SYSCTL_DECL(_kern_geom);
SYSCTL_NODE(_kern_geom, OID_AUTO, linux_lvm, CTLFLAG_RW, 0,
"GEOM_LINUX_LVM stuff");
static u_int g_llvm_debug = 0;
-SYSCTL_UINT(_kern_geom_linux_lvm, OID_AUTO, debug, CTLFLAG_RWTUN, &g_llvm_debug, 0,
+TUNABLE_INT("kern.geom.linux_lvm.debug", &g_llvm_debug);
+SYSCTL_UINT(_kern_geom_linux_lvm, OID_AUTO, debug, CTLFLAG_RW, &g_llvm_debug, 0,
"Debug level");
LIST_HEAD(, g_llvm_vg) vg_list;
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 2fae439..e4dffdc 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -54,18 +54,24 @@ SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, mirror, CTLFLAG_RW, 0,
"GEOM_MIRROR stuff");
u_int g_mirror_debug = 0;
-SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, debug, CTLFLAG_RWTUN, &g_mirror_debug, 0,
+TUNABLE_INT("kern.geom.mirror.debug", &g_mirror_debug);
+SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, debug, CTLFLAG_RW, &g_mirror_debug, 0,
"Debug level");
static u_int g_mirror_timeout = 4;
-SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, timeout, CTLFLAG_RWTUN, &g_mirror_timeout,
+TUNABLE_INT("kern.geom.mirror.timeout", &g_mirror_timeout);
+SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, timeout, CTLFLAG_RW, &g_mirror_timeout,
0, "Time to wait on all mirror components");
static u_int g_mirror_idletime = 5;
-SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, idletime, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.mirror.idletime", &g_mirror_idletime);
+SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, idletime, CTLFLAG_RW,
&g_mirror_idletime, 0, "Mark components as clean when idling");
static u_int g_mirror_disconnect_on_failure = 1;
-SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, disconnect_on_failure, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.mirror.disconnect_on_failure",
+ &g_mirror_disconnect_on_failure);
+SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, disconnect_on_failure, CTLFLAG_RW,
&g_mirror_disconnect_on_failure, 0, "Disconnect component on I/O failure.");
static u_int g_mirror_syncreqs = 2;
+TUNABLE_INT("kern.geom.mirror.sync_requests", &g_mirror_syncreqs);
SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, sync_requests, CTLFLAG_RDTUN,
&g_mirror_syncreqs, 0, "Parallel synchronization I/O requests.");
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 2a04ba3..8429fa0 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -123,8 +123,9 @@ SYSCTL_DECL(_kern_geom);
SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0,
"GEOM_PART stuff");
static u_int check_integrity = 1;
+TUNABLE_INT("kern.geom.part.check_integrity", &check_integrity);
SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity,
- CTLFLAG_RWTUN, &check_integrity, 1,
+ CTLFLAG_RW | CTLFLAG_TUN, &check_integrity, 1,
"Enable integrity checking");
/*
diff --git a/sys/geom/part/g_part_ldm.c b/sys/geom/part/g_part_ldm.c
index 82bf76d..40c2eb8 100644
--- a/sys/geom/part/g_part_ldm.c
+++ b/sys/geom/part/g_part_ldm.c
@@ -55,16 +55,18 @@ static SYSCTL_NODE(_kern_geom_part, OID_AUTO, ldm, CTLFLAG_RW, 0,
"GEOM_PART_LDM Logical Disk Manager");
static u_int ldm_debug = 0;
+TUNABLE_INT("kern.geom.part.ldm.debug", &ldm_debug);
SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, debug,
- CTLFLAG_RWTUN, &ldm_debug, 0, "Debug level");
+ CTLFLAG_RW | CTLFLAG_TUN, &ldm_debug, 0, "Debug level");
/*
* This allows access to mirrored LDM volumes. Since we do not
* doing mirroring here, it is not enabled by default.
*/
static u_int show_mirrors = 0;
+TUNABLE_INT("kern.geom.part.ldm.show_mirrors", &show_mirrors);
SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, show_mirrors,
- CTLFLAG_RWTUN, &show_mirrors, 0, "Show mirrored volumes");
+ CTLFLAG_RW | CTLFLAG_TUN, &show_mirrors, 0, "Show mirrored volumes");
#define LDM_DEBUG(lvl, fmt, ...) do { \
if (ldm_debug >= (lvl)) { \
diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c
index db9cf44..858cf4c 100644
--- a/sys/geom/raid/g_raid.c
+++ b/sys/geom/raid/g_raid.c
@@ -53,38 +53,49 @@ static MALLOC_DEFINE(M_RAID, "raid_data", "GEOM_RAID Data");
SYSCTL_DECL(_kern_geom);
SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff");
int g_raid_enable = 1;
-SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.enable", &g_raid_enable);
+SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RW,
&g_raid_enable, 0, "Enable on-disk metadata taste");
u_int g_raid_aggressive_spare = 0;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.aggressive_spare", &g_raid_aggressive_spare);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, aggressive_spare, CTLFLAG_RW,
&g_raid_aggressive_spare, 0, "Use disks without metadata as spare");
u_int g_raid_debug = 0;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, debug, CTLFLAG_RWTUN, &g_raid_debug, 0,
+TUNABLE_INT("kern.geom.raid.debug", &g_raid_debug);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, debug, CTLFLAG_RW, &g_raid_debug, 0,
"Debug level");
int g_raid_read_err_thresh = 10;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, read_err_thresh, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.read_err_thresh", &g_raid_read_err_thresh);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, read_err_thresh, CTLFLAG_RW,
&g_raid_read_err_thresh, 0,
"Number of read errors equated to disk failure");
u_int g_raid_start_timeout = 30;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, start_timeout, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.start_timeout", &g_raid_start_timeout);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, start_timeout, CTLFLAG_RW,
&g_raid_start_timeout, 0,
"Time to wait for all array components");
static u_int g_raid_clean_time = 5;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, clean_time, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.clean_time", &g_raid_clean_time);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, clean_time, CTLFLAG_RW,
&g_raid_clean_time, 0, "Mark volume as clean when idling");
static u_int g_raid_disconnect_on_failure = 1;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, disconnect_on_failure, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.disconnect_on_failure",
+ &g_raid_disconnect_on_failure);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, disconnect_on_failure, CTLFLAG_RW,
&g_raid_disconnect_on_failure, 0, "Disconnect component on I/O failure.");
static u_int g_raid_name_format = 0;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, name_format, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.name_format", &g_raid_name_format);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, name_format, CTLFLAG_RW,
&g_raid_name_format, 0, "Providers name format.");
static u_int g_raid_idle_threshold = 1000000;
-SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.idle_threshold", &g_raid_idle_threshold);
+SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RW,
&g_raid_idle_threshold, 1000000,
"Time in microseconds to consider a volume idle.");
static u_int ar_legacy_aliases = 1;
-SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN,
+SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RW,
&ar_legacy_aliases, 0, "Create aliases named as the legacy ataraid style.");
+TUNABLE_INT("kern.geom_raid.legacy_aliases", &ar_legacy_aliases);
#define MSLEEP(rv, ident, mtx, priority, wmesg, timeout) do { \
diff --git a/sys/geom/raid/g_raid.h b/sys/geom/raid/g_raid.h
index f6aa6db..8a96fa9 100644
--- a/sys/geom/raid/g_raid.h
+++ b/sys/geom/raid/g_raid.h
@@ -364,8 +364,10 @@ int g_raid_md_modevent(module_t, int, void *);
SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \
NULL, label " metadata module"); \
SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \
- CTLFLAG_RWTUN, &g_raid_md_##name##_class.mdc_enable, 0, \
- "Enable " label " metadata format taste")
+ CTLFLAG_RW, &g_raid_md_##name##_class.mdc_enable, 0, \
+ "Enable " label " metadata format taste"); \
+ TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \
+ &g_raid_md_##name##_class.mdc_enable)
/*
* KOBJ parent class of data transformation modules.
@@ -401,8 +403,10 @@ int g_raid_tr_modevent(module_t, int, void *);
SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \
NULL, label " transformation module"); \
SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \
- CTLFLAG_RWTUN, &g_raid_tr_##name##_class.trc_enable, 0, \
- "Enable " label " transformation module taste")
+ CTLFLAG_RW, &g_raid_tr_##name##_class.trc_enable, 0, \
+ "Enable " label " transformation module taste"); \
+ TUNABLE_INT("kern.geom.raid." __XSTRING(name) ".enable", \
+ &g_raid_tr_##name##_class.trc_enable)
const char * g_raid_volume_level2str(int level, int qual);
int g_raid_volume_str2level(const char *str, int *level, int *qual);
diff --git a/sys/geom/raid/tr_raid1.c b/sys/geom/raid/tr_raid1.c
index 17c7a25..833655b 100644
--- a/sys/geom/raid/tr_raid1.c
+++ b/sys/geom/raid/tr_raid1.c
@@ -46,25 +46,33 @@ SYSCTL_DECL(_kern_geom_raid_raid1);
#define RAID1_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */
static int g_raid1_rebuild_slab = RAID1_REBUILD_SLAB;
-SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_slab_size, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1.rebuild_slab_size",
+ &g_raid1_rebuild_slab);
+SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_slab_size, CTLFLAG_RW,
&g_raid1_rebuild_slab, 0,
"Amount of the disk to rebuild each read/write cycle of the rebuild.");
#define RAID1_REBUILD_FAIR_IO 20 /* use 1/x of the available I/O */
static int g_raid1_rebuild_fair_io = RAID1_REBUILD_FAIR_IO;
-SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_fair_io, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1.rebuild_fair_io",
+ &g_raid1_rebuild_fair_io);
+SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_fair_io, CTLFLAG_RW,
&g_raid1_rebuild_fair_io, 0,
"Fraction of the I/O bandwidth to use when disk busy for rebuild.");
#define RAID1_REBUILD_CLUSTER_IDLE 100
static int g_raid1_rebuild_cluster_idle = RAID1_REBUILD_CLUSTER_IDLE;
-SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1.rebuild_cluster_idle",
+ &g_raid1_rebuild_cluster_idle);
+SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RW,
&g_raid1_rebuild_cluster_idle, 0,
"Number of slabs to do each time we trigger a rebuild cycle");
#define RAID1_REBUILD_META_UPDATE 1024 /* update meta data every 1GB or so */
static int g_raid1_rebuild_meta_update = RAID1_REBUILD_META_UPDATE;
-SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_meta_update, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1.rebuild_meta_update",
+ &g_raid1_rebuild_meta_update);
+SYSCTL_UINT(_kern_geom_raid_raid1, OID_AUTO, rebuild_meta_update, CTLFLAG_RW,
&g_raid1_rebuild_meta_update, 0,
"When to update the meta data.");
diff --git a/sys/geom/raid/tr_raid1e.c b/sys/geom/raid/tr_raid1e.c
index b357742..404b9e6 100644
--- a/sys/geom/raid/tr_raid1e.c
+++ b/sys/geom/raid/tr_raid1e.c
@@ -48,25 +48,33 @@ SYSCTL_DECL(_kern_geom_raid_raid1e);
#define RAID1E_REBUILD_SLAB (1 << 20) /* One transation in a rebuild */
static int g_raid1e_rebuild_slab = RAID1E_REBUILD_SLAB;
-SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_slab_size, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1e.rebuild_slab_size",
+ &g_raid1e_rebuild_slab);
+SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_slab_size, CTLFLAG_RW,
&g_raid1e_rebuild_slab, 0,
"Amount of the disk to rebuild each read/write cycle of the rebuild.");
#define RAID1E_REBUILD_FAIR_IO 20 /* use 1/x of the available I/O */
static int g_raid1e_rebuild_fair_io = RAID1E_REBUILD_FAIR_IO;
-SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_fair_io, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1e.rebuild_fair_io",
+ &g_raid1e_rebuild_fair_io);
+SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_fair_io, CTLFLAG_RW,
&g_raid1e_rebuild_fair_io, 0,
"Fraction of the I/O bandwidth to use when disk busy for rebuild.");
#define RAID1E_REBUILD_CLUSTER_IDLE 100
static int g_raid1e_rebuild_cluster_idle = RAID1E_REBUILD_CLUSTER_IDLE;
-SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1e.rebuild_cluster_idle",
+ &g_raid1e_rebuild_cluster_idle);
+SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_cluster_idle, CTLFLAG_RW,
&g_raid1e_rebuild_cluster_idle, 0,
"Number of slabs to do each time we trigger a rebuild cycle");
#define RAID1E_REBUILD_META_UPDATE 1024 /* update meta data every 1GB or so */
static int g_raid1e_rebuild_meta_update = RAID1E_REBUILD_META_UPDATE;
-SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_meta_update, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid.raid1e.rebuild_meta_update",
+ &g_raid1e_rebuild_meta_update);
+SYSCTL_UINT(_kern_geom_raid_raid1e, OID_AUTO, rebuild_meta_update, CTLFLAG_RW,
&g_raid1e_rebuild_meta_update, 0,
"When to update the meta data.");
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c
index f935f78..927cb31 100644
--- a/sys/geom/raid3/g_raid3.c
+++ b/sys/geom/raid3/g_raid3.c
@@ -54,32 +54,42 @@ SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, raid3, CTLFLAG_RW, 0,
"GEOM_RAID3 stuff");
u_int g_raid3_debug = 0;
-SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, debug, CTLFLAG_RWTUN, &g_raid3_debug, 0,
+TUNABLE_INT("kern.geom.raid3.debug", &g_raid3_debug);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, debug, CTLFLAG_RW, &g_raid3_debug, 0,
"Debug level");
static u_int g_raid3_timeout = 4;
-SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, timeout, CTLFLAG_RWTUN, &g_raid3_timeout,
+TUNABLE_INT("kern.geom.raid3.timeout", &g_raid3_timeout);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, timeout, CTLFLAG_RW, &g_raid3_timeout,
0, "Time to wait on all raid3 components");
static u_int g_raid3_idletime = 5;
-SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, idletime, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid3.idletime", &g_raid3_idletime);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, idletime, CTLFLAG_RW,
&g_raid3_idletime, 0, "Mark components as clean when idling");
static u_int g_raid3_disconnect_on_failure = 1;
-SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, disconnect_on_failure, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.raid3.disconnect_on_failure",
+ &g_raid3_disconnect_on_failure);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, disconnect_on_failure, CTLFLAG_RW,
&g_raid3_disconnect_on_failure, 0, "Disconnect component on I/O failure.");
static u_int g_raid3_syncreqs = 2;
+TUNABLE_INT("kern.geom.raid3.sync_requests", &g_raid3_syncreqs);
SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, sync_requests, CTLFLAG_RDTUN,
&g_raid3_syncreqs, 0, "Parallel synchronization I/O requests.");
static u_int g_raid3_use_malloc = 0;
+TUNABLE_INT("kern.geom.raid3.use_malloc", &g_raid3_use_malloc);
SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, use_malloc, CTLFLAG_RDTUN,
&g_raid3_use_malloc, 0, "Use malloc(9) instead of uma(9).");
static u_int g_raid3_n64k = 50;
-SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n64k, CTLFLAG_RDTUN, &g_raid3_n64k, 0,
+TUNABLE_INT("kern.geom.raid3.n64k", &g_raid3_n64k);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n64k, CTLFLAG_RD, &g_raid3_n64k, 0,
"Maximum number of 64kB allocations");
static u_int g_raid3_n16k = 200;
-SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n16k, CTLFLAG_RDTUN, &g_raid3_n16k, 0,
+TUNABLE_INT("kern.geom.raid3.n16k", &g_raid3_n16k);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n16k, CTLFLAG_RD, &g_raid3_n16k, 0,
"Maximum number of 16kB allocations");
static u_int g_raid3_n4k = 1200;
-SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n4k, CTLFLAG_RDTUN, &g_raid3_n4k, 0,
+TUNABLE_INT("kern.geom.raid3.n4k", &g_raid3_n4k);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n4k, CTLFLAG_RD, &g_raid3_n4k, 0,
"Maximum number of 4kB allocations");
static SYSCTL_NODE(_kern_geom_raid3, OID_AUTO, stat, CTLFLAG_RW, 0,
diff --git a/sys/geom/shsec/g_shsec.c b/sys/geom/shsec/g_shsec.c
index bfdc8fd..9f8723f 100644
--- a/sys/geom/shsec/g_shsec.c
+++ b/sys/geom/shsec/g_shsec.c
@@ -71,10 +71,12 @@ SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, shsec, CTLFLAG_RW, 0,
"GEOM_SHSEC stuff");
static u_int g_shsec_debug = 0;
-SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, debug, CTLFLAG_RWTUN, &g_shsec_debug, 0,
+TUNABLE_INT("kern.geom.shsec.debug", &g_shsec_debug);
+SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, debug, CTLFLAG_RW, &g_shsec_debug, 0,
"Debug level");
static u_int g_shsec_maxmem = MAXPHYS * 100;
-SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, maxmem, CTLFLAG_RDTUN, &g_shsec_maxmem,
+TUNABLE_INT("kern.geom.shsec.maxmem", &g_shsec_maxmem);
+SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, maxmem, CTLFLAG_RD, &g_shsec_maxmem,
0, "Maximum memory that can be allocated for I/O (in bytes)");
static u_int g_shsec_alloc_failed = 0;
SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, alloc_failed, CTLFLAG_RD,
diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c
index 1e88e6d..474d888 100644
--- a/sys/geom/stripe/g_stripe.c
+++ b/sys/geom/stripe/g_stripe.c
@@ -71,9 +71,11 @@ SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, stripe, CTLFLAG_RW, 0,
"GEOM_STRIPE stuff");
static u_int g_stripe_debug = 0;
-SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, debug, CTLFLAG_RWTUN, &g_stripe_debug, 0,
+TUNABLE_INT("kern.geom.stripe.debug", &g_stripe_debug);
+SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, debug, CTLFLAG_RW, &g_stripe_debug, 0,
"Debug level");
static int g_stripe_fast = 0;
+TUNABLE_INT("kern.geom.stripe.fast", &g_stripe_fast);
static int
g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS)
{
@@ -85,10 +87,11 @@ g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS)
g_stripe_fast = fast;
return (error);
}
-SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RWTUN,
+SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RW,
NULL, 0, g_sysctl_stripe_fast, "I", "Fast, but memory-consuming, mode");
static u_int g_stripe_maxmem = MAXPHYS * 100;
-SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RDTUN, &g_stripe_maxmem,
+TUNABLE_INT("kern.geom.stripe.maxmem", &g_stripe_maxmem);
+SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RD, &g_stripe_maxmem,
0, "Maximum memory that can be allocated in \"fast\" mode (in bytes)");
static u_int g_stripe_fast_failed = 0;
SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, fast_failed, CTLFLAG_RD,
diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c
index 84d10a5..15a62a1 100644
--- a/sys/geom/vinum/geom_vinum.c
+++ b/sys/geom/vinum/geom_vinum.c
@@ -50,7 +50,8 @@ SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, vinum, CTLFLAG_RW, 0,
"GEOM_VINUM stuff");
u_int g_vinum_debug = 0;
-SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RWTUN, &g_vinum_debug, 0,
+TUNABLE_INT("kern.geom.vinum.debug", &g_vinum_debug);
+SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RW, &g_vinum_debug, 0,
"Debug level");
static int gv_create(struct g_geom *, struct gctl_req *);
diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c
index a1774a9..40e25d1 100644
--- a/sys/geom/virstor/g_virstor.c
+++ b/sys/geom/virstor/g_virstor.c
@@ -84,16 +84,20 @@ static SYSCTL_NODE(_kern_geom, OID_AUTO, virstor, CTLFLAG_RW, 0,
"GEOM_GVIRSTOR information");
static u_int g_virstor_debug = 2; /* XXX: lower to 2 when released to public */
-SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, debug, CTLFLAG_RWTUN, &g_virstor_debug,
+TUNABLE_INT("kern.geom.virstor.debug", &g_virstor_debug);
+SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, debug, CTLFLAG_RW, &g_virstor_debug,
0, "Debug level (2=production, 5=normal, 15=excessive)");
static u_int g_virstor_chunk_watermark = 100;
-SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, chunk_watermark, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.virstor.chunk_watermark", &g_virstor_chunk_watermark);
+SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, chunk_watermark, CTLFLAG_RW,
&g_virstor_chunk_watermark, 0,
"Minimum number of free chunks before issuing administrative warning");
static u_int g_virstor_component_watermark = 1;
-SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, component_watermark, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.geom.virstor.component_watermark",
+ &g_virstor_component_watermark);
+SYSCTL_UINT(_kern_geom_virstor, OID_AUTO, component_watermark, CTLFLAG_RW,
&g_virstor_component_watermark, 0,
"Minimum number of free components before issuing administrative warning");
OpenPOWER on IntegriCloud