Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/g_bio.9
Show All 18 Lines | |||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd Mar 7, 2018 | .Dd August 5, 2019 | ||||
.Dt G_BIO 9 | .Dt G_BIO 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm g_new_bio , | .Nm g_new_bio , | ||||
.Nm g_clone_bio , | .Nm g_clone_bio , | ||||
.Nm g_destroy_bio , | .Nm g_destroy_bio , | ||||
.Nm g_print_bio , | .Nm g_format_bio , | ||||
.Nm g_reset_bio | .Nm g_reset_bio | ||||
.Nd "GEOM bio controlling functions" | .Nd "GEOM bio controlling functions" | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/bio.h | .In sys/bio.h | ||||
.In geom/geom.h | .In geom/geom.h | ||||
.Ft "struct bio *" | .Ft "struct bio *" | ||||
.Fn g_new_bio void | .Fn g_new_bio void | ||||
.Ft "struct bio *" | .Ft "struct bio *" | ||||
.Fn g_alloc_bio void | .Fn g_alloc_bio void | ||||
.Ft "struct bio *" | .Ft "struct bio *" | ||||
.Fn g_clone_bio "struct bio *bp" | .Fn g_clone_bio "struct bio *bp" | ||||
.Ft "struct bio *" | .Ft "struct bio *" | ||||
.Fn g_duplicate_bio "struct bio *bp" | .Fn g_duplicate_bio "struct bio *bp" | ||||
.Ft void | .Ft void | ||||
.Fn g_destroy_bio "struct bio *bp" | .Fn g_destroy_bio "struct bio *bp" | ||||
.Ft void | .Ft void | ||||
.Fn g_print_bio "struct bio *bp" | .Fn g_format_bio "struct sbuf *sb" "struct bio *bp" | ||||
.Ft void | .Ft void | ||||
.Fn g_reset_bio "struct bio *bp" | .Fn g_reset_bio "struct bio *bp" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
A | A | ||||
.Vt "struct bio" | .Vt "struct bio" | ||||
is used by GEOM to describe I/O requests, its | is used by GEOM to describe I/O requests, its | ||||
most important fields are described below: | most important fields are described below: | ||||
.Bl -tag -width ".Va bio_attribute" | .Bl -tag -width ".Va bio_attribute" | ||||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn g_destroy_bio | .Fn g_destroy_bio | ||||
function deallocates and destroys the given | function deallocates and destroys the given | ||||
.Vt bio | .Vt bio | ||||
structure. | structure. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn g_print_bio | .Fn g_format_bio | ||||
function prints information about the given | function prints information about the given | ||||
.Vt bio | .Vt bio | ||||
structure (for debugging purposes). | structure (for debugging purposes) | ||||
into the provided | |||||
.Vt sbuf . | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn g_reset_bio | .Fn g_reset_bio | ||||
function resets the given | function resets the given | ||||
.Vt bio | .Vt bio | ||||
structure back to its initial state. | structure back to its initial state. | ||||
.Fn g_reset_bio | .Fn g_reset_bio | ||||
preserves internal data structures, while setting all | preserves internal data structures, while setting all | ||||
Show All 38 Lines | |||||
.Bd -literal -offset indent | .Bd -literal -offset indent | ||||
void | void | ||||
example_start(struct bio *bp) | example_start(struct bio *bp) | ||||
{ | { | ||||
struct example_softc *sc; | struct example_softc *sc; | ||||
struct bio *cbp; | struct bio *cbp; | ||||
printf("Request received: "); | printf("Request received: "); | ||||
g_print_bio(bp); | |||||
printf("\\n"); | printf("\\n"); | ||||
markj: It doesn't really make sense to have these be separate printf() calls. | |||||
cemAuthorUnsubmitted Done Inline ActionsAh, sure. Will fix cem: Ah, sure. Will fix | |||||
sc = bp->bio_to->geom->softc; | sc = bp->bio_to->geom->softc; | ||||
if (sc == NULL) { | if (sc == NULL) { | ||||
g_io_deliver(bp, ENXIO); | g_io_deliver(bp, ENXIO); | ||||
return; | return; | ||||
} | } | ||||
/* Let's clone our bio request. */ | /* Let's clone our bio request. */ | ||||
Show All 32 Lines |
It doesn't really make sense to have these be separate printf() calls.