lvm.c revision 2603474ff9be2418900581da1af5cccc9f13cae1
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 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 <ctype.h>
#include "libvolume_id.h"
#include "libvolume_id-private.h"
#include "util.h"
struct lvm1_super_block {
} PACKED;
struct lvm2_super_block {
} PACKED;
struct lvm2_pv_header {
} PACKED;
#define LVM1_SB_OFF 0x400
#define LVM1_MAGIC "HM"
{
struct lvm1_super_block *lvm;
return -1;
return -1;
return 0;
}
#define LVM2_LABEL_ID "LABELONE"
#define LVM2LABEL_SCAN_SECTORS 4
{
unsigned int soff;
struct lvm2_super_block *lvm;
struct lvm2_pv_header *pvhdr;
return -1;
goto found;
}
return -1;
dbg("found at offset 0x%x (pv hdr offset 0x%x)\n",
return 0;
}