Deleted Added
full compact
g_bio.9 (125699) g_bio.9 (125714)
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_bio.9 125699 2004-02-11 10:06:18Z pjd $
25.\" $FreeBSD: head/share/man/man9/g_bio.9 125714 2004-02-11 18:36:31Z pjd $
26.\"
27.Dd January 16, 2004
28.Dt g_bio 9
29.Os
30.Sh NAME
31.Nm g_new_bio ,
32.Nm g_clone_bio ,
26.\"
27.Dd January 16, 2004
28.Dt g_bio 9
29.Os
30.Sh NAME
31.Nm g_new_bio ,
32.Nm g_clone_bio ,
33.Nm g_destroy_bio
33.Nm g_destroy_bio ,
34.Nm g_print_bio
34.Nd "bio controlling functions"
35.Sh SYNOPSIS
36.In sys/bio.h
37.In geom/geom.h
38.Ft "struct bio *"
39.Fn g_new_bio void
40.Ft "struct bio *"
41.Fn g_clone_bio "struct bio *bp"
42.Ft void
43.Fn g_destroy_bio "struct bio *bp"
35.Nd "bio controlling functions"
36.Sh SYNOPSIS
37.In sys/bio.h
38.In geom/geom.h
39.Ft "struct bio *"
40.Fn g_new_bio void
41.Ft "struct bio *"
42.Fn g_clone_bio "struct bio *bp"
43.Ft void
44.Fn g_destroy_bio "struct bio *bp"
45.Ft void
46.Fn g_print_bio "struct bio *bp"
44.Sh DESCRIPTION
45The
46.Fa bio
47structure is used by GEOM to describe I/O requests.
48Most important fields of
49.Fa struct bio
50are described below:
51.Bl -tag -width ".Va bio_attribute"

--- 110 unchanged lines hidden (view full) ---

162Schedule the clone on its own consumer.
163.El
164.Pp
165The
166.Fn g_destroy_bio
167function kills the given
168.Vt bio
169structure.
47.Sh DESCRIPTION
48The
49.Fa bio
50structure is used by GEOM to describe I/O requests.
51Most important fields of
52.Fa struct bio
53are described below:
54.Bl -tag -width ".Va bio_attribute"

--- 110 unchanged lines hidden (view full) ---

165Schedule the clone on its own consumer.
166.El
167.Pp
168The
169.Fn g_destroy_bio
170function kills the given
171.Vt bio
172structure.
173.Pp
174The
175.Fn g_print_bio
176function prints informations about given
177.Vt bio
178structure.
170.Sh EXAMPLES
171Implementation of
172.Dq Dv NULL Ns \-transformation ,
173meaning that an I/O request is cloned and scheduled down without any
174modifications.
175Let's assume that field
176.Va ex_consumer
177in structure
178.Vt example_softc
179contains a consumer attached to the provider we want to operate on.
180.Bd -literal -offset indent
181void
182example_start(struct bio *bp)
183{
184 struct example_softc *sc;
185 struct bio *cbp;
186
179.Sh EXAMPLES
180Implementation of
181.Dq Dv NULL Ns \-transformation ,
182meaning that an I/O request is cloned and scheduled down without any
183modifications.
184Let's assume that field
185.Va ex_consumer
186in structure
187.Vt example_softc
188contains a consumer attached to the provider we want to operate on.
189.Bd -literal -offset indent
190void
191example_start(struct bio *bp)
192{
193 struct example_softc *sc;
194 struct bio *cbp;
195
196 printf("Request received: ");
197 g_print_bio();
198 printf("\\n");
199
187 sc = bp->bio_to->geom->softc;
188 if (sc == NULL) {
189 g_io_deliver(bp, ENXIO);
190 return;
191 }
192
193 /* Let's clone our bio request. */
194 cbp = g_clone_bio(bp);

--- 30 unchanged lines hidden ---
200 sc = bp->bio_to->geom->softc;
201 if (sc == NULL) {
202 g_io_deliver(bp, ENXIO);
203 return;
204 }
205
206 /* Let's clone our bio request. */
207 cbp = g_clone_bio(bp);

--- 30 unchanged lines hidden ---