aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/zero
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2005-12-08 23:06:59 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2005-12-08 23:06:59 +0000
commit24e1fdcd1a69eee6390b0cdfa7dfb00d78c5b7bd (patch)
tree3eb73d101829707395e3e10ba0b0b85dc18c0e04 /sys/geom/zero
parentdf3d5a19fcb4015fa20b062d1785582e1367f82f (diff)
downloadsrc-24e1fdcd1a69eee6390b0cdfa7dfb00d78c5b7bd.tar.gz
src-24e1fdcd1a69eee6390b0cdfa7dfb00d78c5b7bd.zip
- Allow to specify the byte which will be used for filling read buffer.
- Improve sysctl description a bit. Submitted by: Ivan Voras <ivoras@gmail.com>
Notes
Notes: svn path=/head/; revision=153251
Diffstat (limited to 'sys/geom/zero')
-rw-r--r--sys/geom/zero/g_zero.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/geom/zero/g_zero.c b/sys/geom/zero/g_zero.c
index d45837918963..4fd7849ccc95 100644
--- a/sys/geom/zero/g_zero.c
+++ b/sys/geom/zero/g_zero.c
@@ -42,9 +42,12 @@
SYSCTL_DECL(_kern_geom);
SYSCTL_NODE(_kern_geom, OID_AUTO, zero, CTLFLAG_RW, 0, "GEOM_ZERO stuff");
-static u_int g_zero_clear = 1;
-SYSCTL_UINT(_kern_geom_zero, OID_AUTO, clear, CTLFLAG_RW, &g_zero_clear, 0,
- "Zero-fill bio_data.");
+static int g_zero_clear = 1;
+SYSCTL_INT(_kern_geom_zero, OID_AUTO, clear, CTLFLAG_RW, &g_zero_clear, 0,
+ "Clear read data buffer");
+static int g_zero_byte = 0;
+SYSCTL_INT(_kern_geom_zero, OID_AUTO, byte, CTLFLAG_RW, &g_zero_byte, 0,
+ "Byte (octet) value to clear the buffers with");
static void
g_zero_start(struct bio *bp)
@@ -54,7 +57,7 @@ g_zero_start(struct bio *bp)
switch (bp->bio_cmd) {
case BIO_READ:
if (g_zero_clear)
- bzero(bp->bio_data, bp->bio_length);
+ memset(bp->bio_data, g_zero_byte, bp->bio_length);
/* FALLTHROUGH */
case BIO_DELETE:
case BIO_WRITE: