diff options
Diffstat (limited to 'static/freebsd/man9/g_consumer.9 3.html')
| -rw-r--r-- | static/freebsd/man9/g_consumer.9 3.html | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/static/freebsd/man9/g_consumer.9 3.html b/static/freebsd/man9/g_consumer.9 3.html deleted file mode 100644 index dbd9d284..00000000 --- a/static/freebsd/man9/g_consumer.9 3.html +++ /dev/null @@ -1,128 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">G_CONSUMER(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">G_CONSUMER(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">g_new_consumer</code>, - <code class="Nm">g_destroy_consumer</code> — <span class="Nd">GEOM - consumers management</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="In">#include - <<a class="In">geom/geom.h</a>></code></p> -<p class="Pp"><var class="Ft">struct g_consumer *</var> - <br/> - <code class="Fn">g_new_consumer</code>(<var class="Fa" style="white-space: nowrap;">struct - g_geom *gp</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">g_destroy_consumer</code>(<var class="Fa" style="white-space: nowrap;">struct - g_consumer *cp</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">A GEOM consumer is the backdoor through which a geom connects to - another GEOM provider and through which I/O requests are sent.</p> -<p class="Pp" id="g_new_consumer">The - <a class="permalink" href="#g_new_consumer"><code class="Fn">g_new_consumer</code></a>() - function creates a new consumer on geom <var class="Fa">gp</var>. Before - using the new consumer, it has to be attached to a provider with - <a class="Xr">g_attach(9)</a> and opened with - <a class="Xr">g_access(9)</a>.</p> -<p class="Pp" id="g_destroy_consumer">The - <a class="permalink" href="#g_destroy_consumer"><code class="Fn">g_destroy_consumer</code></a>() - function destroys the given consumer and cancels all related pending events. - This function is the last stage of killing an unwanted consumer.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="RESTRICTIONS/CONDITIONS"><a class="permalink" href="#RESTRICTIONS/CONDITIONS">RESTRICTIONS/CONDITIONS</a></h1> -<p class="Pp"><code class="Fn">g_new_consumer</code>():</p> -<ul class="Bl-item Bd-indent"> - <li>The geom <var class="Fa">gp</var> has to have an - <var class="Va">orphan</var> method defined.</li> - <li>The topology lock has to be held.</li> -</ul> -<p class="Pp" id="g_destroy_consumer~2"><a class="permalink" href="#g_destroy_consumer~2"><code class="Fn">g_destroy_consumer</code></a>():</p> -<ul class="Bl-item Bd-indent"> - <li>The consumer must not be attached to a provider.</li> - <li>The access count has to be 0.</li> - <li>The topology lock has to be held.</li> -</ul> -</section> -<section class="Sh"> -<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN - VALUES</a></h1> -<p class="Pp">The <code class="Fn">g_new_consumer</code>() function returns a - pointer to the newly created consumer.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> -<p class="Pp">Create consumer, attach it to given provider, gain read access and - clean up.</p> -<div class="Bd Pp Bd-indent Li"> -<pre>void -some_function(struct g_geom *mygeom, struct g_provider *pp) -{ - struct g_consumer *cp; - - g_topology_assert(); - - /* Create new consumer on 'mygeom' geom. */ - cp = g_new_consumer(mygeom); - /* Attach newly created consumer to given provider. */ - if (g_attach(cp, pp) != 0) { - g_destroy_consumer(cp); - return; - } - /* Open provider for reading through our consumer. */ - if (g_access(cp, 1, 0, 0) != 0) { - g_detach(cp); - g_destroy_consumer(cp); - return; - } - - g_topology_unlock(); - /* - * Read data from provider. - */ - g_topology_lock(); - - /* Disconnect from provider (release access count). */ - g_access(cp, -1, 0, 0); - /* Detach from provider. */ - g_detach(cp); - /* Destroy consumer. */ - g_destroy_consumer(cp); -}</pre> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">geom(4)</a>, - <a class="Xr">DECLARE_GEOM_CLASS(9)</a>, <a class="Xr">g_access(9)</a>, - <a class="Xr">g_attach(9)</a>, <a class="Xr">g_bio(9)</a>, - <a class="Xr">g_data(9)</a>, <a class="Xr">g_event(9)</a>, - <a class="Xr">g_geom(9)</a>, <a class="Xr">g_provider(9)</a>, - <a class="Xr">g_provider_by_name(9)</a>, - <a class="Xr">g_wither_geom(9)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">This manual page was written by <span class="An">Pawel Jakub - Dawidek</span> - <<a class="Mt" href="mailto:pjd@FreeBSD.org">pjd@FreeBSD.org</a>>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">January 16, 2004</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
