Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/virtio/block/virtio_blk.c
Show All 12 Lines | |||||
struct sysctl_oid_list *child; | struct sysctl_oid_list *child; | ||||
dev = sc->vtblk_dev; | dev = sc->vtblk_dev; | ||||
ctx = device_get_sysctl_ctx(dev); | ctx = device_get_sysctl_ctx(dev); | ||||
tree = device_get_sysctl_tree(dev); | tree = device_get_sysctl_tree(dev); | ||||
child = SYSCTL_CHILDREN(tree); | child = SYSCTL_CHILDREN(tree); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "writecache_mode", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "writecache_mode", | ||||
CTLTYPE_INT | CTLFLAG_RW, sc, 0, vtblk_write_cache_sysctl, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, | ||||
vtblk_write_cache_sysctl, | |||||
"I", "Write cache mode (writethrough (0) or writeback (1))"); | "I", "Write cache mode (writethrough (0) or writeback (1))"); | ||||
} | } | ||||
static int | static int | ||||
vtblk_tunable_int(struct vtblk_softc *sc, const char *knob, int def) | vtblk_tunable_int(struct vtblk_softc *sc, const char *knob, int def) | ||||
{ | { | ||||
char path[64]; | char path[64]; | ||||
snprintf(path, sizeof(path), | snprintf(path, sizeof(path), | ||||
"hw.vtblk.%d.%s", device_get_unit(sc->vtblk_dev), knob); | "hw.vtblk.%d.%s", device_get_unit(sc->vtblk_dev), knob); | ||||
TUNABLE_INT_FETCH(path, &def); | TUNABLE_INT_FETCH(path, &def); | ||||
return (def); | return (def); | ||||
} | } | ||||
Context not available. |