2 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 * Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved.
5 * This file is part of LVM2.
7 * This copyrighted material is made available to anyone wishing to use,
8 * modify, copy, or redistribute it subject to the terms and conditions
9 * of the GNU Lesser General Public License v.2.1.
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this program; if not, write to the Free Software Foundation,
13 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 struct physical_volume {
26 const struct format_type *fmt;
29 * vg_name and vgid are used before the parent VG struct exists.
30 * FIXME: Investigate removal/substitution with 'vg' fields.
36 * 'vg' is set and maintained when the PV belongs to a 'pvs'
37 * list in a parent VG struct.
39 struct volume_group *vg;
44 /* physical extents */
48 uint32_t pe_alloc_count;
49 unsigned long pe_align;
50 unsigned long pe_align_offset;
52 struct dm_list segments; /* Ordered pv_segments covering complete PV */
56 char *pv_fmt_dup(const struct physical_volume *pv);
57 char *pv_name_dup(const struct physical_volume *pv);
58 struct device *pv_dev(const struct physical_volume *pv);
59 const char *pv_vg_name(const struct physical_volume *pv);
60 char *pv_attr_dup(struct dm_pool *mem, const struct physical_volume *pv);
61 const char *pv_dev_name(const struct physical_volume *pv);
62 char *pv_uuid_dup(const struct physical_volume *pv);
63 char *pv_tags_dup(const struct physical_volume *pv);
64 uint64_t pv_size(const struct physical_volume *pv);
65 uint64_t pv_size_field(const struct physical_volume *pv);
66 uint64_t pv_dev_size(const struct physical_volume *pv);
67 uint64_t pv_free(const struct physical_volume *pv);
68 uint64_t pv_status(const struct physical_volume *pv);
69 uint32_t pv_pe_size(const struct physical_volume *pv);
70 uint64_t pv_pe_start(const struct physical_volume *pv);
71 uint32_t pv_pe_count(const struct physical_volume *pv);
72 uint32_t pv_pe_alloc_count(const struct physical_volume *pv);
73 uint64_t pv_mda_size(const struct physical_volume *pv);
74 uint64_t pv_mda_free(const struct physical_volume *pv);
75 uint64_t pv_used(const struct physical_volume *pv);
76 uint32_t pv_mda_count(const struct physical_volume *pv);
77 uint32_t pv_mda_used_count(const struct physical_volume *pv);
78 unsigned pv_mda_set_ignored(const struct physical_volume *pv, unsigned ignored);
79 int is_orphan(const struct physical_volume *pv);
80 int is_missing_pv(const struct physical_volume *pv);
81 int is_pv(const struct physical_volume *pv);
83 #endif /* _LVM_PV_H */