~ubuntu-branches/ubuntu/gutsy/evms/gutsy

« back to all changes in this revision

Viewing changes to plugins/multipath/mp_lvm.h

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-09-14 19:32:30 UTC
  • mfrom: (2.1.13 edgy)
  • Revision ID: james.westby@ubuntu.com-20060914193230-4b1pmy0coqk81sqa
Tags: 2.5.5-18
* Apply patches from upstream:
  * cli_query_segfault.patch, fixes a segfault in the CLI when doing a
    query.
  * cli_reload_options.patch, reloads the right option descriptors after
    a change.
  * ntfs_unmkfs.patch, fixes a bug in the wiping of NTFS file systems.
  * raid5_remove_spare_fix.patch + raid5_remove_spare_fix_2.patch, lets the
    user remove a spare if resync does not run.
  * raid5_algorithm.patch, makes EVMS heed the parity algorithm the user
    selects when creating a RAID-5 array.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   (C) Copyright IBM Corp. 2004
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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
 
17
 *
 
18
 * Module: Multipath Plugin - LVM PV detection.
 
19
 * File: evms2/engine/plugins/multipath/mp_lvm.h
 
20
 *
 
21
 * Metadata structures and other information needed for detecting LVM
 
22
 * multipath-PVs.
 
23
 */
 
24
 
 
25
#define NAME_LEN                128
 
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.
 
28
 
 
29
/**
 
30
 * struct lvm_disk_data_t
 
31
 *
 
32
 * Disk stored PV, VG, LV and PE size and offset information.
 
33
 **/
 
34
typedef struct lvm_disk_data {
 
35
        uint32_t base;
 
36
        uint32_t size;
 
37
} lvm_disk_data_t;
 
38
 
 
39
/**
 
40
 * struct pv_disk_v2
 
41
 *
 
42
 * PV disk structure.
 
43
 **/
 
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 */
 
55
        uint32_t pv_major;
 
56
        uint32_t pv_number;
 
57
        uint32_t pv_status;
 
58
        uint32_t pv_allocatable;
 
59
        uint32_t pv_size;
 
60
        uint32_t lv_cur;
 
61
        uint32_t pe_size;
 
62
        uint32_t pe_total;
 
63
        uint32_t pe_allocated;
 
64
        
 
65
        /* New in struct version 2 */
 
66
        uint32_t pe_start;              /* in sectors */
 
67
 
 
68
} pv_disk_t;
 
69
 
 
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);
 
82