g_new_providerf g_destroy_provider g_error_provider - GEOM providers management
The
g_new_providerf ();
function creates a new provider on given geom
Fa gp .
The name of the provider, which will appear as device in
devfs(5),
is created
in a
printf(3)
-like way from the rest of
the arguments.
After creation, the caller has to set the provider's
mediasize
and
sectorsize
as well as other desired initializations, and then call
g_error_provider ();
to reset the provider's error, which is initially set to
Er ENXIO .
The
g_destroy_provider ();
function destroys the given provider, cancels all related pending events and
removes the corresponding devfs entry.
The
g_error_provider ();
function is used to set the provider's error value.
If set to a nonzero, all I/O requests will be denied,
as well as increasing its access count will not be possible (error
Fa error
will be returned).
g_destroy_provider (:);
struct g_provider *
create_example_provider(struct g_geom *gp)
{
struct g_provider *pp;
g_topology_lock();
pp = g_new_providerf(gp, "example_provider");
g_topology_unlock();
pp->mediasize = 65536;
pp->sectorsize = 512;
g_error_provider(pp, 0);
return (pp);
}
|
Закладки на сайте Проследить за страницей |
Created 1996-2025 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |