NAME

SYNOPSIS

DESCRIPTION

The geom (do not confuse “geom” with “GEOM”) is an instance of a GEOM
class. For example: in a typical i386 FreeBSD system, there will be one
geom of class MBR for each disk. The geom’s name is not really
important, it is only used in the XML dump and for debugging purposes.
There can be many geoms with the same name.
The g_new_geomf() function creates a new geom, which will be an instance
of the class mp. The geom’s name is created in a printf(3)-like way from
the rest of the arguments.
The g_destroy_geom() function destroys the given geom immediately and
cancels all related pending events.
The g_geom structure contains fields that should be set by the caller
after geom creation, but before creating any providers or consumers
related to this geom (not all are required):
g_start_t*start
Pointer to a function used for I/O processing.
g_spoiled_t*spoiled
Pointer to a function used for consumers spoiling.
g_dumpconf_t*dumpconf
Pointer to a function used for configuration in XML format
dumping.
g_access_t*access
Pointer to a function used for access control.
g_orphan_t*orphan
Pointer to a function used to inform about orphaned
consumer.
g_ioctl_t*ioctl
Pointer to a function used for handling ioctl requests.
void*softc
Field for private use.

RESTRICTIONS/CONDITIONS

If you intend to use providers in this geom you must set field start of
your geom.
If you are planning to use consumers in your geom you must set fields
orphan and access for it.
g_new_geomf():
Class mp must be valid (registered in GEOM).
The topology lock has to be held.
g_destroy_geom():
The geom cannot posses any providers.
The geom cannot posses any consumers.
The topology lock has to be held.

RETURNVALUES

The g_new_geomf() function returns a pointer to the newly created geom.