libgeom.3 (152760) | libgeom.3 (169299) |
---|---|
1.\" Copyright (c) 2003 Poul-Henning Kamp | 1.\" Copyright (c) 2003 Poul-Henning Kamp |
2.\" Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> |
|
2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright --- 10 unchanged lines hidden (view full) --- 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" | 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 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright --- 10 unchanged lines hidden (view full) --- 21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" |
28.\" $FreeBSD: head/lib/libgeom/libgeom.3 152760 2005-11-24 10:43:35Z ru $ | 29.\" $FreeBSD: head/lib/libgeom/libgeom.3 169299 2007-05-06 01:17:46Z pjd $ |
29.\" | 30.\" |
30.Dd March 7, 2004 | 31.Dd May 6, 2007 |
31.Dt LIBGEOM 3 32.Os 33.Sh NAME 34.Nm geom_stats_open , 35.Nm geom_stats_close , 36.Nm geom_stats_resync , 37.Nm geom_stats_snapshot_get , 38.Nm geom_stats_snapshot_free , 39.Nm geom_stats_snapshot_timestamp , 40.Nm geom_stats_snapshot_reset , 41.Nm geom_stats_snapshot_next , 42.Nm gctl_get_handle , 43.Nm gctl_ro_param , 44.Nm gctl_rw_param , 45.Nm gctl_issue , 46.Nm gctl_free , | 32.Dt LIBGEOM 3 33.Os 34.Sh NAME 35.Nm geom_stats_open , 36.Nm geom_stats_close , 37.Nm geom_stats_resync , 38.Nm geom_stats_snapshot_get , 39.Nm geom_stats_snapshot_free , 40.Nm geom_stats_snapshot_timestamp , 41.Nm geom_stats_snapshot_reset , 42.Nm geom_stats_snapshot_next , 43.Nm gctl_get_handle , 44.Nm gctl_ro_param , 45.Nm gctl_rw_param , 46.Nm gctl_issue , 47.Nm gctl_free , |
47.Nm gctl_dump | 48.Nm gctl_dump , 49.Nm g_open , 50.Nm g_close , 51.Nm g_mediasize , 52.Nm g_sectorsize , 53.Nm g_flush , 54.Nm g_delete , 55.Nm g_get_ident , 56.Nm g_get_name , 57.Nm g_open_by_ident |
48.Nd userland API library for kernel GEOM subsystem 49.Sh LIBRARY 50.Lb libgeom 51.Sh SYNOPSIS 52.In libgeom.h 53.Ss "Statistics Functions" 54.Ft void 55.Fn geom_stats_close void --- 19 unchanged lines hidden (view full) --- 75.Ft void 76.Fn gctl_rw_param "struct gctl_req *req" "const char *name" "int len" "void *value" 77.Ft "const char *" 78.Fn gctl_issue "struct gctl_req *req" 79.Ft void 80.Fn gctl_free "struct gctl_req *req" 81.Ft void 82.Fn gctl_dump "struct gctl_req *req" "FILE *f" | 58.Nd userland API library for kernel GEOM subsystem 59.Sh LIBRARY 60.Lb libgeom 61.Sh SYNOPSIS 62.In libgeom.h 63.Ss "Statistics Functions" 64.Ft void 65.Fn geom_stats_close void --- 19 unchanged lines hidden (view full) --- 85.Ft void 86.Fn gctl_rw_param "struct gctl_req *req" "const char *name" "int len" "void *value" 87.Ft "const char *" 88.Fn gctl_issue "struct gctl_req *req" 89.Ft void 90.Fn gctl_free "struct gctl_req *req" 91.Ft void 92.Fn gctl_dump "struct gctl_req *req" "FILE *f" |
93.Ss "Utility Functions" 94.Ft int 95.Fn g_open "const char *name" "int write" 96.Ft int 97.Fn g_close "int fd" 98.Ft off_t 99.Fn g_mediasize "int fd" 100.Ft ssize_t 101.Fn g_sectorsize "int fd" 102.Ft int 103.Fn g_flush "int fd" 104.Ft int 105.Fn g_delete "int fd" "off_t offset" "off_t length" 106.Ft int 107.Fn g_get_ident "int fd" "char *ident" "size_t size" 108.Ft int 109.Fn g_get_name "const char *ident" "char *name" "size_t size" 110.Ft int 111.Fn g_open_by_ident "const char *ident" "int write" "char *name" "size_t size" |
|
83.Sh DESCRIPTION 84The 85.Nm geom 86library contains the official and publicized API for 87interacting with the GEOM subsystem in the kernel. 88.Ss "Statistics Functions" 89GEOM collects statistics data for all consumers and providers, but does 90not perform any normalization or presentation on the raw data, this is --- 136 unchanged lines hidden (view full) --- 227.Pp 228Error handling for the control functions is postponed until the call 229to 230.Fn gctl_issue , 231which returns 232.Dv NULL 233on success, or an error message corresponding to the 234first error which happened. | 112.Sh DESCRIPTION 113The 114.Nm geom 115library contains the official and publicized API for 116interacting with the GEOM subsystem in the kernel. 117.Ss "Statistics Functions" 118GEOM collects statistics data for all consumers and providers, but does 119not perform any normalization or presentation on the raw data, this is --- 136 unchanged lines hidden (view full) --- 256.Pp 257Error handling for the control functions is postponed until the call 258to 259.Fn gctl_issue , 260which returns 261.Dv NULL 262on success, or an error message corresponding to the 263first error which happened. |
264.Ss "Utility Functions" 265The 266.Fn g_* 267functions are used to communicate with GEOM providers. 268.Pp 269The 270.Fn g_open 271function opens the given provider and returns file descriptor number, which can 272be used with other functions. 273The 274.Fa write 275argument indicates if operations that modify the provider (like 276.Fn g_flush 277or 278.Fn g_delete ) 279are going to be called. 280.Pp 281The 282.Fn g_close 283function closes the provider. 284.Pp 285The 286.Fn g_mediasize 287function returns size of the given provider. 288.Pp 289The 290.Fn g_sectorsize 291function returns sector size of the given provider. 292.Pp 293The 294.Fn g_flush 295function sends 296.Dv BIO_FLUSH 297request to flush write cache of the provider. 298.Pp 299The 300.Fn g_delete 301function tells the provider that the given data range is no longer used. 302.Pp 303The 304.Fn g_get_ident 305function returns provider's fixed and unique identifier. 306The 307.Fa ident 308argument should be at least 309.Dv DISK_IDENT_SIZE 310big. 311.Pp 312The 313.Fn g_get_name 314function returns name of the provider, which identifier is equal to the 315.Fa ident 316string. 317.Pp 318The 319.Fn g_open_by_ident 320function opens provider using its ident, unlike 321.Fn g_open 322which uses provider's name. 323If the 324.Fa name 325argument is not 326.Dv NULL , 327the function will store provider's name there. 328.Pp 329All functions return value greater than or equal to 330.Va 0 331on success or 332.Va -1 333on failure. |
|
235.Sh EXAMPLES 236Create a request that is to be sent to the CCD class, and tell 237it to destroy a specific geom: 238.Bd -literal -offset indent 239H = gctl_get_handle(); 240gctl_ro_param(H, "verb", -1, "destroy geom"); 241gctl_ro_param(H, "class", -1, "CCD"); 242sprintf(buf, "ccd%d", ccd); --- 8 unchanged lines hidden (view full) --- 251.Sh HISTORY 252The 253.Nm geom 254library appeared in 255.Fx 5.1 . 256.Sh AUTHORS 257.An Poul-Henning Kamp Aq phk@FreeBSD.org 258.An Lukas Ertl Aq le@FreeBSD.org | 334.Sh EXAMPLES 335Create a request that is to be sent to the CCD class, and tell 336it to destroy a specific geom: 337.Bd -literal -offset indent 338H = gctl_get_handle(); 339gctl_ro_param(H, "verb", -1, "destroy geom"); 340gctl_ro_param(H, "class", -1, "CCD"); 341sprintf(buf, "ccd%d", ccd); --- 8 unchanged lines hidden (view full) --- 350.Sh HISTORY 351The 352.Nm geom 353library appeared in 354.Fx 5.1 . 355.Sh AUTHORS 356.An Poul-Henning Kamp Aq phk@FreeBSD.org 357.An Lukas Ertl Aq le@FreeBSD.org |
358.An Pawel Jakub Dawidek pjd@FreeBSD.org |
|