2
* (C) Copyright IBM Corp. 2004
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12
* the GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
* Module: Multipath Plugin - LVM PV detection.
19
* File: evms2/engine/plugins/multipath/mp_lvm.h
21
* Metadata structures and other information needed for detecting LVM
26
#define LVM_PV_DISK_BASE 0L // Base of PV structure on disk.
27
#define LVM_PV_DISK_SIZE 1024L // Size reserved for PV structure on disk.
30
* struct lvm_disk_data_t
32
* Disk stored PV, VG, LV and PE size and offset information.
34
typedef struct lvm_disk_data {
44
typedef struct pv_disk_v2 {
45
uint8_t id[2]; /* Identifier == HM */
46
uint16_t version; /* LVM version */
47
lvm_disk_data_t pv_on_disk;
48
lvm_disk_data_t vg_on_disk;
49
lvm_disk_data_t pv_uuidlist_on_disk;
50
lvm_disk_data_t lv_on_disk;
51
lvm_disk_data_t pe_on_disk;
52
uint8_t pv_uuid[NAME_LEN];
53
uint8_t vg_name[NAME_LEN];
54
uint8_t system_id[NAME_LEN]; /* for vgexport/vgimport */
58
uint32_t pv_allocatable;
63
uint32_t pe_allocated;
65
/* New in struct version 2 */
66
uint32_t pe_start; /* in sectors */
70
/* Multipath sub-module APIs for LVM. */
71
extern int mp_lvm_setup(void);
72
extern void mp_lvm_cleanup(void);
73
extern int mp_lvm_probe(storage_object_t *child);
74
extern int mp_lvm_process(list_anchor_t output_list);
75
extern int mp_lvm_allocate(storage_object_t *object);
76
extern int mp_lvm_discard(storage_object_t *object);
77
extern int mp_lvm_delete(storage_object_t *object);
78
extern int mp_lvm_map(storage_object_t **object,
79
lsn_t *lsn, sector_count_t *count);
80
extern int mp_lvm_build_targets(storage_object_t *object,
81
dm_target_t **targets);