openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/libfdisk/src/label.c
int fdisk_probe_labels(struct fdisk_context* cxt)
{
    size_t i;

    cxt->label = NULL;

    for (i = 0; i < cxt->nlabels; i++)
    {
        struct fdisk_label* lb = cxt->labels[i];
        struct fdisk_label* org = fdisk_get_label(cxt, NULL);
        int rc;

        if (!lb->op->probe)
            continue;
        if (lb->disabled)
        {
            DBG(CXT, ul_debugobj(cxt, "%s: disabled -- ignore", lb->name));
            continue;
        }
        DBG(CXT, ul_debugobj(cxt, "probing for %s", lb->name));

        cxt->label = lb;
        rc = lb->op->probe(cxt);
        cxt->label = org;

        if (rc != 1)
        {
            if (lb->op->deinit)
                lb->op->deinit(lb); /* for sure */
            continue;
        }

        __fdisk_switch_label(cxt, lb);
        return 0;
    }

    DBG(CXT, ul_debugobj(cxt, "no label found"));
    return 1; /* not found */
}
/**
 * SECTION: label
 * @title: Label
 * @short_description: disk label (PT) specific data and functions
 *
 * The fdisk_new_context() initializes all label drivers, and allocate
 * per-label specific data struct. This concept allows to store label specific
 * settings to the label driver independently on the currently active label
 * driver. Note that label struct cannot be deallocated, so there is no
 * reference counting for fdisk_label objects. All is destroyed by
 * fdisk_unref_context() only.
 *
 * Anyway, all label drives share in-memory first sector. The function
 * fdisk_create_disklabel() overwrites this in-memory sector. But it's possible
 * that label driver also uses another buffers, for example GPT reads more
 * sectors from the device.
 *
 * All label operations are in-memory only, except fdisk_write_disklabel().
 *
 * All functions that use "struct fdisk_context" rather than "struct
 * fdisk_label" use the currently active label driver.
 */
label
@title: Label
@short_description: disk label (PT) specific data and functions

The fdisk_new_context() initializes all label drivers, and allocate
per-label specific data struct. This concept allows to store label specific
settings to the label driver independently on the currently active label
driver. Note that label struct cannot be deallocated, so there is no
reference counting for fdisk_label objects. All is destroyed by
fdisk_unref_context() only.

Anyway, all label drives share in-memory first sector. The function
fdisk_create_disklabel() overwrites this in-memory sector. But it's possible
that label driver also uses another buffers, for example GPT reads more
sectors from the device.

All label operations are in-memory only, except fdisk_write_disklabel().

All functions that use "struct fdisk_context" rather than "struct
fdisk_label" use the currently active label driver.
label @title : Label @short_description : disk label ( PT ) specific data and functions The fdisk_new_context () initializes all label drivers and allocate per - label specific data struct . This concept allows to store label specific settings to the label driver independently on the currently active label driver . Note that label struct cannot be deallocated so there is no reference counting for fdisk_label objects . All is destroyed by fdisk_unref_context () only . Anyway all label drives share in - memory first sector . The function fdisk_create_disklabel () overwrites this in - memory sector . But it ' s possible that label driver also uses another buffers for example GPT reads more sectors from the device . All label operations are in - memory only except fdisk_write_disklabel () . All functions that use " struct fdisk_context " rather than " struct fdisk_label " use the currently active label driver .
int fdisk_probe_labels(struct fdisk_context* cxt)
{
    size_t i;
    cxt->label = NULL;
    for (i = 0; i < cxt->nlabels; i++)
    {
        struct fdisk_label* lb = cxt->labels[i];
        struct fdisk_label* org = fdisk_get_label(cxt, NULL);
        int rc;
        if (!lb->op->probe)
            continue;
        if (lb->disabled)
        {
            DBG(CXT, ul_debugobj(cxt, "%s: disabled -- ignore", lb->name));
            continue;
        }
        DBG(CXT, ul_debugobj(cxt, "probing for %s", lb->name));
        cxt->label = lb;
        rc = lb->op->probe(cxt);
        cxt->label = org;
        if (rc != 1)
        {
            if (lb->op->deinit)
                lb->op->deinit(lb); 
            continue;
        }
        __fdisk_switch_label(cxt, lb);
        return 0;
    }
    DBG(CXT, ul_debugobj(cxt, "no label found"));
    return 1; 
}
int fdisk_probe_labels ( struct fdisk_context * cxt ) { size_t i ; cxt -> label = NULL ; for ( i = 0 ; i < cxt -> nlabels ; i ++ ) { struct fdisk_label * lb = cxt -> labels [ i ] ; struct fdisk_label * org = fdisk_get_label ( cxt , NULL ) ; int rc ; if ( ! lb -> op -> probe ) continue ; if ( lb -> disabled ) { DBG ( CXT , ul_debugobj ( cxt , " " , lb -> name ) ) ; continue ; } DBG ( CXT , ul_debugobj ( cxt , " " , lb -> name ) ) ; cxt -> label = lb ; rc = lb -> op -> probe ( cxt ) ; cxt -> label = org ; if ( rc != 1 ) { if ( lb -> op -> deinit ) lb -> op -> deinit ( lb ) ; continue ; } __fdisk_switch_label ( cxt , lb ) ; return 0 ; } DBG ( CXT , ul_debugobj ( cxt , " " ) ) ; return 1 ; }
SECTION: label
 @title: Label
 @short_description: disk label (PT) specific data and functions
SECTION : label @title : Label @short_description : disk label ( PT ) specific data and functions
/* for sure */ /* not found */