g_geom.9 (131594) | g_geom.9 (131689) |
---|---|
1.\" 2.\" Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 8 unchanged lines hidden (view full) --- 17.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24.\" | 1.\" 2.\" Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 8 unchanged lines hidden (view full) --- 17.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24.\" |
25.\" $FreeBSD: head/share/man/man9/g_geom.9 131594 2004-07-04 20:55:50Z ru $ | 25.\" $FreeBSD: head/share/man/man9/g_geom.9 131689 2004-07-06 08:21:12Z ru $ |
26.\" 27.Dd January 16, 2004 | 26.\" 27.Dd January 16, 2004 |
28.Dt g_geom 9 | 28.Dt G_GEOM 9 |
29.Os 30.Sh NAME 31.Nm g_new_geomf , 32.Nm g_destroy_geom 33.Nd "geom management" 34.Sh SYNOPSIS 35.In geom/geom.h 36.Ft "struct g_geom *" 37.Fn g_new_geomf "struct g_class *mp" "const char *fmt" ... 38.Ft void 39.Fn g_destroy_geom "struct g_geom *gp" 40.Sh DESCRIPTION 41The geom (do not confuse 42.Dq geom 43with 44.Dq GEOM ) 45is an instance of a GEOM class. | 29.Os 30.Sh NAME 31.Nm g_new_geomf , 32.Nm g_destroy_geom 33.Nd "geom management" 34.Sh SYNOPSIS 35.In geom/geom.h 36.Ft "struct g_geom *" 37.Fn g_new_geomf "struct g_class *mp" "const char *fmt" ... 38.Ft void 39.Fn g_destroy_geom "struct g_geom *gp" 40.Sh DESCRIPTION 41The geom (do not confuse 42.Dq geom 43with 44.Dq GEOM ) 45is an instance of a GEOM class. |
46For example: in a typical i386 FreeBSD system, there will be one geom | 46For example: in a typical i386 47.Fx 48system, there will be one geom |
47of class MBR for each disk. 48The geom's name is not really important, it is only used in the XML 49dump and for debugging purposes. 50There can be many geoms with the same name. 51.Pp 52The 53.Fn g_new_geomf 54function creates a new geom, which will be an instance of the class 55.Fa mp . | 49of class MBR for each disk. 50The geom's name is not really important, it is only used in the XML 51dump and for debugging purposes. 52There can be many geoms with the same name. 53.Pp 54The 55.Fn g_new_geomf 56function creates a new geom, which will be an instance of the class 57.Fa mp . |
56The geom's name is created in a printf-like way from the rest of the arguments. | 58The geom's name is created in a 59.Xr printf 3 Ns 60-like way from the rest of the arguments. |
57.Pp 58The 59.Fn g_destroy_geom 60function destroys the given geom immediately and cancels all related pending 61events. 62.Pp 63The 64.Vt g_geom 65structure 66contains fields that should be set by the caller after geom creation, but before 67creating any providers or consumers related to this geom (not all are required): | 61.Pp 62The 63.Fn g_destroy_geom 64function destroys the given geom immediately and cancels all related pending 65events. 66.Pp 67The 68.Vt g_geom 69structure 70contains fields that should be set by the caller after geom creation, but before 71creating any providers or consumers related to this geom (not all are required): |
68.Bl -inset -offset indent | 72.Bl -tag -offset indent -width indent |
69.It Vt "g_start_t *" Va start 70Pointer to a function used for I/O processing. 71.It Vt "g_spoiled_t *" Va spoiled 72Pointer to a function used for consumers spoiling. 73.It Vt "g_dumpconf_t *" Va dumpconf 74Pointer to a function used for configuration in XML format dumping. 75.It Vt "g_access_t *" Va access 76Pointer to a function used for access control. --- 23 unchanged lines hidden (view full) --- 100must be valid (registered in GEOM). 101.It 102The topology lock has to be held. 103.El 104.Pp 105.Fn g_destroy_geom : 106.Bl -item -offset indent 107.It | 73.It Vt "g_start_t *" Va start 74Pointer to a function used for I/O processing. 75.It Vt "g_spoiled_t *" Va spoiled 76Pointer to a function used for consumers spoiling. 77.It Vt "g_dumpconf_t *" Va dumpconf 78Pointer to a function used for configuration in XML format dumping. 79.It Vt "g_access_t *" Va access 80Pointer to a function used for access control. --- 23 unchanged lines hidden (view full) --- 104must be valid (registered in GEOM). 105.It 106The topology lock has to be held. 107.El 108.Pp 109.Fn g_destroy_geom : 110.Bl -item -offset indent 111.It |
108The geom can not posses any providers. | 112The geom cannot posses any providers. |
109.It | 113.It |
110The geom can not posses any consumers. | 114The geom cannot posses any consumers. |
111.It 112The topology lock has to be held. 113.El 114.Sh RETURN VALUES | 115.It 116The topology lock has to be held. 117.El 118.Sh RETURN VALUES |
119The |
|
115.Fn g_new_geomf | 120.Fn g_new_geomf |
121function |
|
116returns a pointer to the newly created geom. 117.Sh EXAMPLES 118Create an example geom. 119.Bd -literal -offset indent 120static struct geom * 121g_example_start(struct bio *bp) 122{ 123 --- 77 unchanged lines hidden --- | 122returns a pointer to the newly created geom. 123.Sh EXAMPLES 124Create an example geom. 125.Bd -literal -offset indent 126static struct geom * 127g_example_start(struct bio *bp) 128{ 129 --- 77 unchanged lines hidden --- |