History log of /freebsd-current/sys/geom/geom_dump.c
Revision Date Author Comments
# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 7f16b501 12-Mar-2022 Alexander Motin <mav@FreeBSD.org>

GEOM: Introduce partial confxml API

Traditionally the GEOM's primary channel of information from kernel to
user-space was confxml, fetched by libgeom through kern.geom.confxml
sysctl. It is convenient and informative, representing full state of
GEOM in a single XML document. But problems start to arise on systems
with hundreds of disks, where the full confxml size reaches many
megabytes, taking significant time to first write it and then parse.

This patch introduces alternative solution, allowing to fetch much
smaller XML document, subset of the full confxml, limited to 64KB and
representing only one specified geom and optionally its parents. It
uses existing GEOM control interface, extended with new "getxml" verb.
In case of any error, such as the buffer overflow, it just transparently
falls back to traditional full confxml. This patch uses the new API in
user-space GEOM tools where it is possible.

Reviewed by: imp
MFC after: 2 month
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D34529


# d40bc607 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

geom: clean up empty lines in .c and .h files


# ae1cce52 13-May-2020 Warner Losh <imp@FreeBSD.org>

Reimplement aliases in geom

The alias needs to be part of the provider instead of the geom to work
properly. To bind the DEV geom, we need to look at the provider's names and
aliases and create the dev entries from there. If this lives in the GEOM, then
it won't propigate down the tree properly. Remove it from geom, add it provider.

Update geli, gmountver, gnop, gpart, and guzip to use it, which handles the bulk
of the uses in FreeBSD. I think this is all the providers that create a new name
based on their parent's name.


# 2efaef42 04-Dec-2019 Alexander Motin <mav@FreeBSD.org>

Wrap g_trace() into a macro to avoid unneeded calls.

In most cases with debug disabled this function does nothing, but argument
passing and the call still cost measurable time due to cache misses, etc.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.


# 49ee0fce 19-Jun-2019 Alexander Motin <mav@FreeBSD.org>

Use sbuf_cat() in GEOM confxml generation.

When it comes to megabytes of text, difference between sbuf_printf() and
sbuf_cat() becomes substantial.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.


# 6d305ab0 27-Oct-2018 Eugene Grosbein <eugen@FreeBSD.org>

Extend stripeoffset and stripesize of GEOMs from u_int to off_t

GEOM's stripeoffset overflows at 4 gigabyte margin (2^32)
because of its u_int type. This leads to incorrect data in the output
generated by "sysctl kern.geom.confxml" command, "graid list" etc.
when GEOM array has volumes larger than 4G, for example.

This change does not affect ABI but changes KBI. No MFC planned.

Differential Revision: https://reviews.freebsd.org/D13426


# 3728855a 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/geom: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# c624eb25 07-Aug-2017 Warner Losh <imp@FreeBSD.org>

Add aliasing concept to geom.

Add an alias name list to geoms. Use them in geom_dev to create
aliases. Previously, geom_dev would create an device node for the name
of the geom. Now, additional nodes are created pointing back to the
primary node with make_dev_alias_p. Aliases must be in place on the
geom before any tasting occurs.

Differential Revision: https://reviews.freebsd.org/D11873


# 2f36085d 26-Mar-2015 Alexander Motin <mav@FreeBSD.org>

Report withered providers as such alike to GEOMs.

MFC after: 2 weeks


# 52fa0beb 17-Oct-2014 Andrey V. Elsukov <ae@FreeBSD.org>

Add provider's sectorsize and stripesize to confdot output.

Submitted by: rpokala at panasas.com


# 7ae1a87b 27-Nov-2013 Alexander Motin <mav@FreeBSD.org>

Escape special XML chars, returned by some devices, confusing XML parsers.

MFC after: 1 month


# 9641a512 21-May-2013 Jaakko Heinonen <jh@FreeBSD.org>

Remove an extra semicolon from the DOT language output.

PR: kern/178540
Submitted by: Trond Endrestol
MFC after: 1 week


# 252c094e 15-Apr-2013 Ivan Voras <ivoras@FreeBSD.org>

Introduce a symbol for the GEOM class name instead of using the ad-hoc string
constant.


# d15033b3 01-Jun-2011 Andrey V. Elsukov <ae@FreeBSD.org>

Do not hide stripeoffset from libgeom(3), it may be useful even when
stripesize is zero.

MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# e3359a8c 10-Apr-2010 Jaakko Heinonen <jh@FreeBSD.org>

MFC r205385:

Escape characters unsafe for XML output in GEOM class, instance and
provider names.

- Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
with '?'. Those characters are disallowed in XML.
- '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
replaced with XML numeric character reference.

If the kern.geom.confxml sysctl provides invalid XML, libgeom
geom_xml2tree() fails and utilities using it do not work. Unsafe
characters are common in msdosfs and cd9660 labels.

PR: kern/104389


# a41aa4a7 20-Mar-2010 Jaakko Heinonen <jh@FreeBSD.org>

Escape characters unsafe for XML output in GEOM class, instance and
provider names.

- Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
with '?'. Those characters are disallowed in XML.
- '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
replaced with XML numeric character reference.

If the kern.geom.confxml sysctl provides invalid XML, libgeom
geom_xml2tree() fails and utilities using it do not work. Unsafe
characters are common in msdosfs and cd9660 labels.

PR: kern/104389
Submitted by: Doug Steinwand (original version)
Reviewed by: pjd
Discussed on: freebsd-geom
MFC after: 3 weeks


# 35daa28f 16-Jan-2010 Xin LI <delphij@FreeBSD.org>

Expose stripe offset and stripe size through libgeom and geom(8) userland
utilities.

Reviewed by: pjd, mav (earlier version)


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# d40f7f8b 12-Nov-2005 Marcel Moolenaar <marcel@FreeBSD.org>

Make the kern.geom.conftxt sysctl more usable by also dumping the
MD class. Previously only the DISK class was dumped. The only
consumer of this sysctl is libdisk (i.e. sysinstall) and it tests
explicitly for instances of the DISK class. Dumping other classes
is therefore harmless.
By also dumping the MD class regression tests can be written that
use the MD class for operations that would normally be done on the
DISK class. The sysctl can now be used to test if those operations
took an effect. An example is partitioning.


# 3d1d5bc3 10-Mar-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Rearrange some of the GEOM debugging tools to be more structured.

Retire g_sanity() and corresponding debugflag (0x8)

Retire g_{stall,release}_events().

Under #ifdef DIAGNOSTIC:

Make g_valid_obj() an official function and have it return an an
non-zero integer which indicates the kind of object when found.

Implement G_VALID_{CLASS,GEOM,CONSUMER,PROVIDER}() macros based
on g_valid_obj().

Sprinkle calls to these macros liberally over the infrastructure.

Always check that we do not free a live object.


# 77411499 06-Dec-2003 Scott Long <scottl@FreeBSD.org>

Re-arrange and consolidate some random debugging stuff


# d32622aa 08-Jul-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Handle geoms which are withering away specially in the dump functions.


# 50b1faef 11-Jun-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID().

Approved by: phk


# a1a9b445 07-Jun-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Add missing va_end() calls.

Noticed by: tmm


# 0a9c130c 23-Apr-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Introduce a g_waitfor_event() function which posts an event and waits for
it to be run (or cancelled) and use this instead of home-rolled versions.


# 3924ad70 13-Apr-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Time has run from the "run GEOM in userland" harness, and the new regression
test is built to test GEOM as running in the kernel.

This commit is basically "unifdef -D_KERNEL" to remove the mainly #include
related code to support the userland-harness.


# 316aed03 02-Apr-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Add handling for cancelled events in the g_call_me() methods.


# afcbcfae 02-Apr-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Change events to have an array of "void *" references, and give the
event posting functions varargs to fill these.

Attribute g_call_me() to appropriate g_geom's where necessary.

Add a flag argument to g_call_me() methods which will be used to signal
cancellation of events in the future.

This commit should be a no-op.


# b4b138c2 18-Mar-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.


# 801bb689 07-Feb-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Commit the correct copy of the g_stat structure.

Add debug.sizeof.g_stat sysctl.

Set the id field of the g_stat when we create consumers and providers.

Remove biocount from consumer, we will use the counters in the g_stat
structure instead. Replace one field which will need to be atomically
manipulated with two fields which will not (stat.nop and stat.nend).

Change add companion field to bio_children: bio_inbed for the exact
same reason.

Don't output the biocount in the confdot output.

Fix KASSERT in g_io_request().

Add sysctl kern.geom.collectstats defaulting to off.

Collect the following raw statistics conditioned on this sysctl:

for each consumer and provider {
total number of operations started.
total number of operations completed.
time last operation completed.
sum of idle-time.
for each of BIO_READ, BIO_WRITE and BIO_DELETE {
number of operations completed.
number of bytes completed.
number of ENOMEM errors.
number of other errors.
sum of transaction time.
}
}

API for getting hold of these statistics data not included yet.


# 0f9d3dba 16-Dec-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Constification and some s/int/u_int/ changes.


# 82e5a9a3 20-Nov-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Do not call the dumpconf method unless there is one.
Compare pointers with NULL.

Partially submitted by: Christian Carstensen <cc@gate5.de>
Approved by: re


# 11af4192 08-Nov-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Remove harmless but irritating printf.


# 5274973a 01-Nov-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Make this compile in the userland shims again.

Sponsored by: DARPA & NAI Labs


# d518e539 28-Oct-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Add the remaning part of the new libdisk interaction.

WARNING: This is not a published interface, it is a stopgap measure for
WARNING: libdisk so we can get 5.0-R out of the door.

Sponsored by: DARPA & NAI Labs


# 48444d62 20-Oct-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Make the sectorsize a property of providers so we can include it in the XML
output.

Sponsored by: DARPA & NAI Labs


# 14ac6812 20-Oct-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Use %jd instead of %lld now that we have it.


# d0e17c1b 14-Oct-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Add more KASSERTS.

Sponsored by: DARPA & NAI Labs.


# 2874f1cf 04-Oct-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Properly isolate the locking domains of sysctl from the topology lock
for the sysctls which report the configuration.

Sponsored by: DARPA & NAI Labs.


# 72840432 30-Sep-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Retire g_io_fail() and let g_io_deliver() take an error argument instead.

Sponsored by: DARPA & NAI Labs.


# 4fbd1268 06-Sep-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Remove "magicspace". It looks good on paper, it doesn't work in practice.

Sponsored by: DARPA & NAI Labs.


# 07107de9 21-May-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Introduce the concept of "magic spaces", and implement them in most of
the relevant classes.

Some methods may implement various "magic spaces", this is reserved
or magic areas on the disk, set a side for various and sundry purposes.
A good example is the BSD disklabel and boot code on i386 which occupies
a total of four magic spaces: boot1, the disklabel, the padding behind
the disklabel and boot2. The reason we don't simply tell people to
write the appropriate stuff on the underlying device is that (some of)
the magic spaces might be real-time modifiable. It is for instance
possible to change a disklabel while partitions are open, provided
the open partitions do not get trampled in the process.

Sponsored by: DARPA & NAI Labs.


# f6424ee5 24-Apr-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Improve the cross-references in the XML output.

Explained by: des
Sponsored by: DARPA & NAI Labs.


# 7d590cc4 23-Apr-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Introduce some serious paranoia to try to catch a memory overwrite problem
as early as possible.

Sponsored by: DARPA & NAI Labs


# 50cbb62e 19-Apr-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Make life easier for reference-vector generatorts in tools/regression/geom
by including a FreeBSD friendly CVS identifier in the XML output.

Sponsored by: DARPA & NAI Labs.


# 2654e1fc 04-Apr-2002 Poul-Henning Kamp <phk@FreeBSD.org>

s/classs/classes/ to fixup grammer after the previous global renaming.

Sponsored by: DARPA & NAI Labs


# 4c0a424c 28-Mar-2002 Poul-Henning Kamp <phk@FreeBSD.org>

In the absense of any smarter way to do this, cast various printf
arguments to silence printf format warnings.


# b1876192 26-Mar-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Eliminate some thread pointers which do not make sense anymore.

Split private parts of geom.h into geom_int.h. The latter should
never be included in class implemtations.


# e805e8f0 26-Mar-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Cave in to tradition and rename "methods" to "classes".


# dd84a43c 11-Mar-2002 Poul-Henning Kamp <phk@FreeBSD.org>

First commit of the GEOM subsystem to make it easier for people to
test and play with this.

This is not yet production quality and should be run only on dedicated
test boxes.

For people who want to develop transformations for GEOM there exist a
set of shims to run geom in userland (ask phk@freebsd.org).

Reports of all kinds to: phk@freebsd.org
Please include in report:
dmesg
sysctl debug.geomdot
sysctl debug.geomconf

Known significant limitations:
no kernel dump facility.
ioctls severely restricted.

Sponsored by: DARPA, NAI Labs