1 /* $NetBSD: layout.h,v 1.1.1.1 2008/12/22 00:18:17 haad Exp $ */
4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
7 * This file is part of LVM2.
9 * This copyrighted material is made available to anyone wishing to use,
10 * modify, copy, or redistribute it subject to the terms and conditions
11 * of the GNU Lesser General Public License v.2.1.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef _LVM_TEXT_LAYOUT_H
19 #define _LVM_TEXT_LAYOUT_H
22 #include "lvm-types.h"
28 uint64_t offset; /* Offset in bytes to start sector */
29 uint64_t size; /* Bytes */
30 } __attribute__ ((packed));
32 /* Data areas (holding PEs) */
33 struct data_area_list {
35 struct disk_locn disk_locn;
38 /* Fields with the suffix _xl should be xlate'd wherever they appear */
41 int8_t pv_uuid[ID_LEN];
43 /* This size can be overridden if PV belongs to a VG */
44 uint64_t device_size_xl; /* Bytes */
46 /* NULL-terminated list of data areas followed by */
47 /* NULL-terminated list of metadata area headers */
48 struct disk_locn disk_areas_xl[0]; /* Two lists */
49 } __attribute__ ((packed));
53 uint64_t offset; /* Offset in bytes to start sector */
54 uint64_t size; /* Bytes */
57 } __attribute__ ((packed));
60 /* Structure size limited to one sector */
62 uint32_t checksum_xl; /* Checksum of rest of mda_header */
63 int8_t magic[16]; /* To aid scans for metadata */
65 uint64_t start; /* Absolute start byte of mda_header */
66 uint64_t size; /* Size of metadata area */
68 struct raw_locn raw_locns[0]; /* NULL-terminated list */
69 } __attribute__ ((packed));
74 struct metadata_area_ops *file_ops;
75 struct metadata_area_ops *raw_ops;
79 struct device_area area;
80 uint64_t free_sectors;
81 struct raw_locn rlocn; /* Store inbetween write and commit */
84 /* FIXME Convert this at runtime */
85 #define FMTT_MAGIC "\040\114\126\115\062\040\170\133\065\101\045\162\060\116\052\076"
86 #define FMTT_VERSION 1
87 #define MDA_HEADER_SIZE 512
88 #define LVM2_LABEL "LVM2 001"
89 #define MDA_SIZE_MIN (8 * (unsigned) lvm_getpagesize())