via_raid.c revision 64b333fdcc69798ab7874cf042d590b3f2d990b5
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* Based on information taken from dmraid:
* Copyright (C) 2004-2006 Heinz Mauelshagen, Red Hat GmbH
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "libvolume_id.h"
#include "libvolume_id-private.h"
struct via_meta {
struct via_array {
} PACKED;
#define VIA_SIGNATURE 0xAA55
/* 8 bit checksum on first 50 bytes of metadata. */
{
while (i--)
}
{
if (size < 0x10000)
return -1;
return -1;
return -1;
return -1;
if (!meta_checksum(via))
return -1;
return 0;
}