diff options
author | pjd <pjd@FreeBSD.org> | 2004-03-24 14:25:46 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-03-24 14:25:46 +0000 |
commit | d1d0abbffad059b55906c0a9ecf7ea2192bec8a7 (patch) | |
tree | 3922ac20d73b08fff1896753886278af8461086a | |
parent | 7456822f8283011cd02c0e010edede0c4189bd8b (diff) | |
download | FreeBSD-src-d1d0abbffad059b55906c0a9ecf7ea2192bec8a7.zip FreeBSD-src-d1d0abbffad059b55906c0a9ecf7ea2192bec8a7.tar.gz |
Functions:
- g_new_geomf(),
- g_new_providerf(),
- g_new_consumer()
cannot failed (by returning NULL), so don't scare programmers.
-rw-r--r-- | share/man/man9/g_access.9 | 2 | ||||
-rw-r--r-- | share/man/man9/g_attach.9 | 2 | ||||
-rw-r--r-- | share/man/man9/g_consumer.9 | 6 | ||||
-rw-r--r-- | share/man/man9/g_geom.9 | 16 | ||||
-rw-r--r-- | share/man/man9/g_provider.9 | 12 |
5 files changed, 11 insertions, 27 deletions
diff --git a/share/man/man9/g_access.9 b/share/man/man9/g_access.9 index f2fd216..df51eb7 100644 --- a/share/man/man9/g_access.9 +++ b/share/man/man9/g_access.9 @@ -100,8 +100,6 @@ some_function(struct g_geom *mygeom, struct g_provider *pp) /* Create new consumer on 'mygeom' geom. */ cp = g_new_consumer(mygeom); - if (cp == NULL) - return; /* Attach newly created consumer to given provider. */ if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); diff --git a/share/man/man9/g_attach.9 b/share/man/man9/g_attach.9 index 5f31d9b..6fcaf58 100644 --- a/share/man/man9/g_attach.9 +++ b/share/man/man9/g_attach.9 @@ -93,8 +93,6 @@ some_function(struct g_geom *mygeom, struct g_provider *pp) /* Create new consumer on 'mygeom' geom. */ cp = g_new_consumer(mygeom); - if (cp == NULL) - return; /* Attach newly created consumer to given provider. */ if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); diff --git a/share/man/man9/g_consumer.9 b/share/man/man9/g_consumer.9 index 67ecc9f4..f0b5b1c 100644 --- a/share/man/man9/g_consumer.9 +++ b/share/man/man9/g_consumer.9 @@ -81,9 +81,7 @@ The topology lock has to be held. .El .Sh RETURN VALUES .Fn g_new_consumer -returns a pointer to the newly created consumer or -.Dv NULL -if an error occured. +returns a pointer to the newly created consumer. .Sh EXAMPLES Create consumer, attach it to given provider, gain read access and clean up. .Bd -literal -offset indent @@ -96,8 +94,6 @@ some_function(struct g_geom *mygeom, struct g_provider *pp) /* Create new consumer on 'mygeom' geom. */ cp = g_new_consumer(mygeom); - if (cp == NULL) - return; /* Attach newly created consumer to given provider. */ if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); diff --git a/share/man/man9/g_geom.9 b/share/man/man9/g_geom.9 index ab2d02c..5d889b1 100644 --- a/share/man/man9/g_geom.9 +++ b/share/man/man9/g_geom.9 @@ -112,9 +112,7 @@ The topology lock has to be held. .El .Sh RETURN VALUES .Fn g_new_geomf -returns a pointer to the newly created geom or -.Dv NULL -if an error occured. +returns a pointer to the newly created geom. .Sh EXAMPLES Create an example geom. .Bd -literal -offset indent @@ -158,13 +156,11 @@ create_example_geom(struct g_class *myclass) g_topology_lock(); gp = g_new_geomf(myclass, "example_geom"); g_topology_unlock(); - if (gp != NULL) { - gp->start = g_example_start; - gp->orphan = g_example_orphan; - gp->spoiled = g_example_spoiled; - gp->access = g_example_access; - gp->softc = NULL; - } + gp->start = g_example_start; + gp->orphan = g_example_orphan; + gp->spoiled = g_example_spoiled; + gp->access = g_example_access; + gp->softc = NULL; return (gp); } diff --git a/share/man/man9/g_provider.9 b/share/man/man9/g_provider.9 index 68f5819..a03dfbc 100644 --- a/share/man/man9/g_provider.9 +++ b/share/man/man9/g_provider.9 @@ -104,9 +104,7 @@ The topology lock has to be held. .El .Sh RETURN VALUES .Fn g_new_providerf -returns a pointer to the newly created provider or -.Dv NULL -if an error occured. +returns a pointer to the newly created provider. .Sh EXAMPLES Create an example provider, set its parameters and make it usable. .Bd -literal -offset indent @@ -117,12 +115,10 @@ create_example_provider(struct g_geom *gp) g_topology_lock(); pp = g_new_providerf(gp, "example_provider"); + pp->mediasize = 65536; + pp->sectorsize = 512; + g_error_provider(pp, 0); g_topology_unlock(); - if (pp != NULL) { - pp->mediasize = 65536; - pp->sectorsize = 512; - g_error_provider(pp, 0); - } return (pp); } |