g_provider.9 (126861) | g_provider.9 (127371) |
---|---|
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_provider.9 126861 2004-03-11 19:53:22Z pjd $ | 25.\" $FreeBSD: head/share/man/man9/g_provider.9 127371 2004-03-24 14:25:46Z pjd $ |
26.\" 27.Dd January 16, 2004 28.Dt g_provider 9 29.Os 30.Sh NAME 31.Nm g_new_providerf , 32.Nm g_destroy_provider , 33.Nm g_error_provider --- 65 unchanged lines hidden (view full) --- 99No consumers have to be attached. 100.It 101The access count has to be 0. 102.It 103The topology lock has to be held. 104.El 105.Sh RETURN VALUES 106.Fn g_new_providerf | 26.\" 27.Dd January 16, 2004 28.Dt g_provider 9 29.Os 30.Sh NAME 31.Nm g_new_providerf , 32.Nm g_destroy_provider , 33.Nm g_error_provider --- 65 unchanged lines hidden (view full) --- 99No consumers have to be attached. 100.It 101The access count has to be 0. 102.It 103The topology lock has to be held. 104.El 105.Sh RETURN VALUES 106.Fn g_new_providerf |
107returns a pointer to the newly created provider or 108.Dv NULL 109if an error occured. | 107returns a pointer to the newly created provider. |
110.Sh EXAMPLES 111Create an example provider, set its parameters and make it usable. 112.Bd -literal -offset indent 113struct g_provider * 114create_example_provider(struct g_geom *gp) 115{ 116 struct g_provider *pp; 117 118 g_topology_lock(); 119 pp = g_new_providerf(gp, "example_provider"); | 108.Sh EXAMPLES 109Create an example provider, set its parameters and make it usable. 110.Bd -literal -offset indent 111struct g_provider * 112create_example_provider(struct g_geom *gp) 113{ 114 struct g_provider *pp; 115 116 g_topology_lock(); 117 pp = g_new_providerf(gp, "example_provider"); |
118 pp->mediasize = 65536; 119 pp->sectorsize = 512; 120 g_error_provider(pp, 0); |
|
120 g_topology_unlock(); | 121 g_topology_unlock(); |
121 if (pp != NULL) { 122 pp->mediasize = 65536; 123 pp->sectorsize = 512; 124 g_error_provider(pp, 0); 125 } | |
126 127 return (pp); 128} 129.Ed 130.Sh SEE ALSO 131.Xr DECLARE_GEOM_CLASS 9 , 132.Xr geom 4 , 133.Xr g_access 9 , --- 12 unchanged lines hidden --- | 122 123 return (pp); 124} 125.Ed 126.Sh SEE ALSO 127.Xr DECLARE_GEOM_CLASS 9 , 128.Xr geom 4 , 129.Xr g_access 9 , --- 12 unchanged lines hidden --- |