Page MenuHomeFreeBSD

D52706.1787897827.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D52706.1787897827.diff

diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -183,6 +183,7 @@
geom.4 \
geom_linux_lvm.4 \
geom_uzip.4 \
+ geom_zero.4 \
gif.4 \
${_gve.4} \
gpio.4 \
diff --git a/share/man/man4/gzero.4 b/share/man/man4/gzero.4
new file mode 100644
--- /dev/null
+++ b/share/man/man4/gzero.4
@@ -0,0 +1,161 @@
+.\" Copyright (c) 2019 Greg White <gkwhite@gmail.com>.
+.\" All rights reserved.
+.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org>
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.Dd July 18, 2025
+.Dt GEOM_ZERO 4
+.Os
+.Sh NAME
+.Nm gzero ,
+.Nm geom_zero
+.Nd the zero disk/block device
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "options GEOM_ZERO"
+.Ed
+.Pp
+To load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+geom_zero="YES"
+.Ed
+.Pp
+To load the driver as a module at run-time,
+run this command as root:
+.Bd -literal -offset indent
+kldload geom_zero
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+is a
+.Xr GEOM 4
+device simulating a one-exabyte disk filled with the byte value
+set via the
+.Va kern.geom.zero.byte
+sysctl variable.
+.Pp
+.Nm
+differs from
+.Xr zero 4 ,
+which is a regular character device and has an infinite length.
+.Pp
+Consult
+.Xr geom 8
+for instructions how on use the supported commands of the
+.Xr GEOM 4
+.Nm ZERO
+class.
+.Pp
+.Nm
+is useful for benchmarks of the speed of a disk or subsystem,
+where compression of the data does not affect the results
+.Po blocks from
+.Pa /dev/gzero
+compress exceptionally well
+.Pc .
+Examples of such benchmarks include
+comparing the speed of two disk encryption algorithms and
+comparing a hardware versus software implementation
+of a single encryption algorithm.
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width "kern.geom.zero.clear"
+.It Va kern.geom.zero.byte
+This variable sets the fill byte of the
+.Nm
+device.
+Default:
+.Ql 0 .
+.It Va kern.geom.zero.clear
+This variable controls the clearing of the read data buffer.
+.\" XXX0MP: It is not clear to me what setting this variable actually entails.
+.\" When set to
+.\" .Ql 0 ,
+.\" .Nm
+.\" will ignore the fill byte value set by
+.\" .Va kern.geom.zero.byte
+.\" and return zeroes instead.
+Default:
+.Ql 1 .
+.El
+.Sh EXAMPLES
+Create the
+.Pa /dev/gzero
+device by loading the
+.Nm
+kernel module:
+.Bd -literal -offset indent
+# geom zero load
+.Ed
+.Pp
+Show information about the
+.Nm
+device:
+.Bd -literal -offset indent
+# geom zero list
+Geom name: gzero
+Providers:
+1. Name: gzero
+ Mediasize: 1152921504606846976 (1.0E)
+ Sectorsize: 512
+ Mode: r0w0egzero0
+.Ed
+.Pp
+Set the fill byte of the
+.Nm
+device to 70
+.Po decimal for letter
+.Dq F
+in
+.Xr ascii 7
+.Pc :
+.Bd -literal -offset indent
+# sysctl kern.geom.zero.byte=70
+kern.geom.zero.byte: 0 -> 70
+# head -c 1 /dev/gzero
+F
+.Ed
+.Sh FILES
+.Bl -tag -width /dev/gzero
+.It Pa /dev/gzero
+The
+.Nm
+device.
+.El
+.Sh SEE ALSO
+.Xr GEOM 4 ,
+.Xr zero 4 ,
+.Xr geom 8 ,
+.Xr sysctl 8
+.Sh HISTORY
+A
+.Nm
+device first appeared in
+.Fx 6 .
+This manual page appeared in
+.Fx 16 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+device was written by
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .
+The
+.Nm
+manual page was originally written by
+.An Greg White Aq Mt gkwhite@gmail.com
+and modified by
+.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org
+before landing in
+.Fx .
diff --git a/share/man/man4/zero.4 b/share/man/man4/zero.4
--- a/share/man/man4/zero.4
+++ b/share/man/man4/zero.4
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 7, 1996
+.Dd September 24, 2025
.Dt ZERO 4
.Os
.Sh NAME
@@ -48,6 +48,7 @@
.El
.Sh SEE ALSO
.Xr full 4 ,
+.Xr gzero 4 ,
.Xr null 4
.Sh HISTORY
A

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 28, 6:17 AM (5 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29476993
Default Alt Text
D52706.1787897827.diff (3 KB)

Event Timeline