|
NAMEDECLARE_GEOM_CLASS —
GEOM class declaration macro
SYNOPSIS#include <geom/geom.h>
DESCRIPTIONTheDECLARE_GEOM_CLASS () macro registers a GEOM class in
GEOM. A GEOM class itself implements one particular kind of transformation.
Typical examples are: MBR disk partition, BSD
disklabel and RAID5 classes. DECLARE_GEOM_CLASS () can
be used both for compiled in and loaded as
kld(4)
modules GEOM classes and it is the only official way for class registration.
The arguments to
Structure g_class contains data describing the class. They are:
Only a name field is required; the rest are optional. RESTRICTIONS/CONDITIONSThe fields of g_class should always be initialized using C99-style field naming (see the initialization of example_class below).EXAMPLESExample class declaration.static struct g_geom * g_example_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { g_topology_assert(); [...] } static void g_example_ctlreq(struct gctl_req *req, struct g_class *cp, char const *verb) { [...] } static int g_example_destroy_geom(struct gctl_req *req, struct g_class *cp, struct g_geom *gp) { g_topology_assert(); [...] } static void g_example_init(struct g_class *mp) { [...] } static void g_example_fini(struct g_class *mp) { [...] } struct g_class example_class = { .name = "EXAMPLE", .taste = g_example_taste, .ctlreq = g_example_ctlreq, .init = g_example_init, .fini = g_example_fini, .destroy_geom = g_example_destroy_geom }; DECLARE_GEOM_CLASS(example_class, g_example); SEE ALSOgeom(4), g_attach(9), g_bio(9), g_consumer(9), g_data(9), g_event(9), g_geom(9), g_provider(9), g_provider_by_name(9), g_wither_geom(9)AUTHORSThis manual page was written by Pawel Jakub Dawidek <pjd@FreeBSD.org>.
Visit the GSP FreeBSD Man Page Interface. |