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/lib/sysfs.c
int sysfs_devno_is_dm_private(dev_t devno, char** uuid)
{
    struct path_cxt* pc = NULL;
    char* id = NULL;
    int rc = 0;

    pc = ul_new_sysfs_path(devno, NULL, NULL);
    if (!pc)
        goto done;
    if (ul_path_read_string(pc, &id, "dm/uuid") <= 0 || !id)
        goto done;

    /* Private LVM devices use "LVM-<uuid>-<name>" uuid format (important
     * is the "LVM" prefix and "-<name>" postfix).
     */
    if (strncmp(id, "LVM-", 4) == 0)
    {
        char* p = strrchr(id + 4, '-');

        if (p && *(p + 1))
            rc = 1;

        /* Private Stratis devices prefix the UUID with "stratis-1-private"
         */
    }
    else if (strncmp(id, "stratis-1-private", 17) == 0)
    {
        rc = 1;
    }
done:
    ul_unref_path(pc);
    if (uuid)
        *uuid = id;
    else
        free(id);
    return rc;
}
/*
 * Returns 1 if the device is private device mapper device. The @uuid
 * (if not NULL) returns DM device UUID, use free() to deallocate.
 */
Returns 1 if the device is private device mapper device. The @uuid
(if not NULL) returns DM device UUID, use free() to deallocate.
Returns 1 if the device is private device mapper device . The @uuid ( if not NULL ) returns DM device UUID use free () to deallocate .
int sysfs_devno_is_dm_private(dev_t devno, char** uuid)
{
    struct path_cxt* pc = NULL;
    char* id = NULL;
    int rc = 0;
    pc = ul_new_sysfs_path(devno, NULL, NULL);
    if (!pc)
        goto done;
    if (ul_path_read_string(pc, &id, "dm/uuid") <= 0 || !id)
        goto done;
    if (strncmp(id, "LVM-", 4) == 0)
    {
        char* p = strrchr(id + 4, '-');
        if (p && *(p + 1))
            rc = 1;
    }
    else if (strncmp(id, "stratis-1-private", 17) == 0)
    {
        rc = 1;
    }
done:
    ul_unref_path(pc);
    if (uuid)
        *uuid = id;
    else
        free(id);
    return rc;
}
int sysfs_devno_is_dm_private ( dev_t devno , char * * uuid ) { struct path_cxt * pc = NULL ; char * id = NULL ; int rc = 0 ; pc = ul_new_sysfs_path ( devno , NULL , NULL ) ; if ( ! pc ) goto done ; if ( ul_path_read_string ( pc , & id , " " ) <= 0 || ! id ) goto done ; if ( strncmp ( id , " " , 4 ) == 0 ) { char * p = strrchr ( id + 4 , ' ' ) ; if ( p && * ( p + 1 ) ) rc = 1 ; } else if ( strncmp ( id , " " , 17 ) == 0 ) { rc = 1 ; } done : ul_unref_path ( pc ) ; if ( uuid ) * uuid = id ; else free ( id ) ; return rc ; }
Returns 1 if the device is private device mapper device.
Returns 1 if the device is private device mapper device .
/* Private LVM devices use "LVM-<uuid>-<name>" uuid format (important
     * is the "LVM" prefix and "-<name>" postfix).
     */ /* Private Stratis devices prefix the UUID with "stratis-1-private"
         */