volume_id.c revision b5e694267142042228a6cac99ecad6c4b4ef8759
/*
* volume_id - reads volume label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <errno.h>
#include <ctype.h>
#include <fcntl.h>
#include "libvolume_id.h"
#include "util.h"
/* the user can overwrite this log function */
{
return;
}
{
return -EINVAL;
/* probe for raid first, cause fs probes may be successful on raid members */
if (size) {
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
}
goto found;
goto found;
goto found;
return -1;
/* If recognized, we free the allocated buffers */
return 0;
}
{
return -EINVAL;
goto found;
/* signature in the first block, only small buffer needed */
goto found;
goto found;
/* fill buffer with maximum */
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
goto found;
return -1;
/* If recognized, we free the allocated buffers */
return 0;
}
{
return -EINVAL;
return 0;
return 0;
return -1;
}
/* open volume by already open file descriptor */
{
return NULL;
return id;
}
/* open volume by device node */
{
int fd;
if (fd < 0) {
return NULL;
}
return NULL;
/* close fd on device close */
return id;
}
{
return;
}