The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

g_provider (9)
  • >> g_provider (9) ( FreeBSD man: Ядро )

  • BSD mandoc
     

    NAME

    
    
    g_new_providerf
    
     
    g_destroy_provider
    
     
    g_error_provider
    
     - GEOM providers management
    
     
    

    SYNOPSIS

       #include <geom/geom.h>
    struct g_provider * g_new_providerf (struct g_geom *gp const char *fmt ...);
    void g_destroy_provider (struct g_provider *pp);
    void g_error_provider (struct g_provider *pp int error);
     

    DESCRIPTION

    A GEOM provider is the front gate at which a geom offers service. A provider is ``a disk-like thing which appears in /dev '' [en] a logical disk in other words. All providers have three main properties: name, sectorsize and size.

    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).  

    RESTRICTIONS/CONDITIONS

    g_new_provider (:);

    The provider name should be unique, but this is not enforced by GEOM.
    If the name is not unique, one will end up with two (or more) files with the same name, which is a programmer error.
    The geom
    Fa gp has to have a Fa start method defined.
    The topology lock has to be held.

    g_destroy_provider (:);

    The provider must not have consumers attached.
    The access count has to be 0.
    The topology lock has to be held.

     

    RETURN VALUES

    The g_new_providerf ();
    function returns a pointer to the newly created provider.  

    EXAMPLES

    Create an example provider, set its parameters and make it usable.
    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);
    }
    
     

    SEE ALSO

    geom(4), DECLARE_GEOM_CLASS9, g_access9, g_attach9, g_bio9, g_consumer9, g_data9, g_event9, g_geom9, g_provider_by_name9, g_wither_geom9  

    AUTHORS

    An -nosplit This manual page was written by An Pawel Jakub Dawidek Aq [email protected] .


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    RESTRICTIONS/CONDITIONS
    RETURN VALUES
    EXAMPLES
    SEE ALSO
    AUTHORS


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру