g_data.9 (131594) | g_data.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_data.9 131594 2004-07-04 20:55:50Z ru $ | 25.\" $FreeBSD: head/share/man/man9/g_data.9 131689 2004-07-06 08:21:12Z ru $ |
26.\" 27.Dd January 16, 2004 | 26.\" 27.Dd January 16, 2004 |
28.Dt g_data 9 | 28.Dt G_DATA 9 |
29.Os 30.Sh NAME 31.Nm g_read_data , 32.Nm g_write_data 33.Nd "read/write data from/to GEOM consumer" 34.Sh SYNOPSIS 35.In geom/geom.h 36.Ft "void *" | 29.Os 30.Sh NAME 31.Nm g_read_data , 32.Nm g_write_data 33.Nd "read/write data from/to GEOM consumer" 34.Sh SYNOPSIS 35.In geom/geom.h 36.Ft "void *" |
37.Fn g_read_data "struct g_consumer *cp" "off_t offset" "off_t length" "int *error" | 37.Fo g_read_data 38.Fa "struct g_consumer *cp" "off_t offset" "off_t length" "int *error" 39.Fc |
38.Ft int | 40.Ft int |
39.Fn g_write_data "struct g_consumer *cp" "off_t offset" "void *ptr" "off_t length" | 41.Fo g_write_data 42.Fa "struct g_consumer *cp" "off_t offset" "void *ptr" "off_t length" 43.Fc |
40.Sh DESCRIPTION 41The 42.Fn g_read_data 43function reads 44.Fa length 45bytes of data from the provider attached to consumer 46.Fa cp , 47starting at offset --- 16 unchanged lines hidden (view full) --- 64.Fa length 65bytes of data from the buffer pointed to by 66.Fa ptr 67to the provider attached to consumer 68.Fa cp , 69starting at offset 70.Fa offset . 71.Sh RESTRICTIONS/CONDITIONS | 44.Sh DESCRIPTION 45The 46.Fn g_read_data 47function reads 48.Fa length 49bytes of data from the provider attached to consumer 50.Fa cp , 51starting at offset --- 16 unchanged lines hidden (view full) --- 68.Fa length 69bytes of data from the buffer pointed to by 70.Fa ptr 71to the provider attached to consumer 72.Fa cp , 73starting at offset 74.Fa offset . 75.Sh RESTRICTIONS/CONDITIONS |
76The |
|
72.Fa length | 77.Fa length |
78argument |
|
73should be a multiple of the provider's sectorsize 74and less than or equal to 75.Dv DFLTPHYS | 79should be a multiple of the provider's sectorsize 80and less than or equal to 81.Dv DFLTPHYS |
76.Dv ( DFLTPHYS is defined in | 82.Dv ( DFLTPHYS 83is defined in |
77.In sys/param.h ) . 78.Pp 79The topology lock must not be held. 80.Sh RETURN VALUES 81The 82.Fn g_read_data 83function returns a pointer to a data buffer or 84.Dv NULL --- 5 unchanged lines hidden (view full) --- 90.Pp 91The 92.Fn g_write_data 93function returns 0 if successful; otherwise an error code is returned. 94.Sh ERRORS 95Possible errors: 96.Bl -tag -width Er 97.It Bq Er EIO | 84.In sys/param.h ) . 85.Pp 86The topology lock must not be held. 87.Sh RETURN VALUES 88The 89.Fn g_read_data 90function returns a pointer to a data buffer or 91.Dv NULL --- 5 unchanged lines hidden (view full) --- 97.Pp 98The 99.Fn g_write_data 100function returns 0 if successful; otherwise an error code is returned. 101.Sh ERRORS 102Possible errors: 103.Bl -tag -width Er 104.It Bq Er EIO |
98Can not read data. | 105Cannot read data. |
99.El 100.Sh SEE ALSO 101.Xr geom 4 , 102.Xr DECLARE_GEOM_CLASS 9 , 103.Xr g_access 9 , 104.Xr g_attach 9 , 105.Xr g_bio 9 , 106.Xr g_consumer 9 , 107.Xr g_event 9 , 108.Xr g_geom 9 , 109.Xr g_provider 9 , 110.Xr g_provider_by_name 9 , 111.Xr g_wither_geom 9 112.Sh AUTHORS 113.An -nosplit 114This manual page was written by 115.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org . | 106.El 107.Sh SEE ALSO 108.Xr geom 4 , 109.Xr DECLARE_GEOM_CLASS 9 , 110.Xr g_access 9 , 111.Xr g_attach 9 , 112.Xr g_bio 9 , 113.Xr g_consumer 9 , 114.Xr g_event 9 , 115.Xr g_geom 9 , 116.Xr g_provider 9 , 117.Xr g_provider_by_name 9 , 118.Xr g_wither_geom 9 119.Sh AUTHORS 120.An -nosplit 121This manual page was written by 122.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org . |