51
51
/* Various flags */
52
/* See metadata-exported.h for the complete list. */
52
53
/* Note that the bits no longer necessarily correspond to LVM1 disk format */
54
//#define PARTIAL_VG 0x00000001U /* VG */
55
//#define EXPORTED_VG 0x00000002U /* VG PV */
56
//#define RESIZEABLE_VG 0x00000004U /* VG */
58
55
/* May any free extents on this PV be used or must they be left free? */
59
//#define ALLOCATABLE_PV 0x00000008U /* PV */
61
#define SPINDOWN_LV 0x00000010U /* LV */
62
#define BADBLOCK_ON 0x00000020U /* LV */
63
//#define VISIBLE_LV 0x00000040U /* LV */
64
//#define FIXED_MINOR 0x00000080U /* LV */
65
/* FIXME Remove when metadata restructuring is completed */
66
//#define SNAPSHOT 0x00001000U /* LV - internal use only */
67
//#define PVMOVE 0x00002000U /* VG LV SEG */
68
//#define LOCKED 0x00004000U /* LV */
69
//#define MIRRORED 0x00008000U /* LV - internal use only */
70
#define VIRTUAL 0x00010000U /* LV - internal use only */
71
//#define MIRROR_LOG 0x00020000U /* LV */
72
//#define MIRROR_IMAGE 0x00040000U /* LV */
73
//#define MIRROR_NOTSYNCED 0x00080000U /* LV */
74
#define PRECOMMITTED 0x00200000U /* VG - internal use only */
75
//#define CONVERTING 0x00400000U /* LV */
77
//#define MISSING_PV 0x00800000U /* PV */
78
//#define PARTIAL_LV 0x01000000U /* LV - derived flag, not
79
// written out in metadata*/
81
#define POSTORDER_FLAG 0x02000000U /* Not real flags, reserved for */
82
#define POSTORDER_OPEN_FLAG 0x04000000U /* temporary use inside vg_read_internal. */
83
#define VIRTUAL_ORIGIN 0x08000000U /* LV - internal use only */
85
//#define LVM_READ 0x00000100U /* LV VG */
86
//#define LVM_WRITE 0x00000200U /* LV VG */
87
//#define CLUSTERED 0x00000400U /* VG */
88
#define SHARED 0x00000800U /* VG */
57
#define SPINDOWN_LV UINT64_C(0x00000010) /* LV */
58
#define BADBLOCK_ON UINT64_C(0x00000020) /* LV */
59
#define VIRTUAL UINT64_C(0x00010000) /* LV - internal use only */
60
#define PRECOMMITTED UINT64_C(0x00200000) /* VG - internal use only */
61
#define POSTORDER_FLAG UINT64_C(0x02000000) /* Not real flags, reserved for */
62
#define POSTORDER_OPEN_FLAG UINT64_C(0x04000000) /* temporary use inside vg_read_internal. */
63
#define VIRTUAL_ORIGIN UINT64_C(0x08000000) /* LV - internal use only */
65
#define SHARED UINT64_C(0x00000800) /* VG */
90
67
/* Format features flags */
91
//#define FMT_SEGMENTS 0x00000001U /* Arbitrary segment params? */
92
//#define FMT_MDAS 0x00000002U /* Proper metadata areas? */
93
//#define FMT_TAGS 0x00000004U /* Tagging? */
94
//#define FMT_UNLIMITED_VOLS 0x00000008U /* Unlimited PVs/LVs? */
95
//#define FMT_RESTRICTED_LVIDS 0x00000010U /* LVID <= 255 */
96
//#define FMT_ORPHAN_ALLOCATABLE 0x00000020U /* Orphan PV allocatable? */
97
68
#define FMT_PRECOMMIT 0x00000040U /* Supports pre-commit? */
98
//#define FMT_RESIZE_PV 0x00000080U /* Supports pvresize? */
99
//#define FMT_UNLIMITED_STRIPESIZE 0x00000100U /* Unlimited stripe size? */
70
struct dm_config_tree;
102
71
struct metadata_area;
104
75
/* Per-format per-metadata area operations */
105
76
struct metadata_area_ops {
106
78
struct volume_group *(*vg_read) (struct format_instance * fi,
107
79
const char *vg_name,
108
struct metadata_area * mda);
80
struct metadata_area * mda,
109
82
struct volume_group *(*vg_read_precommit) (struct format_instance * fi,
110
83
const char *vg_name,
111
84
struct metadata_area * mda);
455
439
* For internal metadata caching.
457
int export_vg_to_buffer(struct volume_group *vg, char **buf);
441
size_t export_vg_to_buffer(struct volume_group *vg, char **buf);
442
int export_vg_to_config_tree(struct volume_group *vg, struct dm_config_tree **cft);
458
443
struct volume_group *import_vg_from_buffer(const char *buf,
459
444
struct format_instance *fid);
460
struct volume_group *import_vg_from_config_tree(const struct config_tree *cft,
445
struct volume_group *import_vg_from_config_tree(const struct dm_config_tree *cft,
461
446
struct format_instance *fid);
470
455
int fixup_imported_mirrors(struct volume_group *vg);
460
int attach_pool_metadata_lv(struct lv_segment *pool_seg,
461
struct logical_volume *pool_metadata_lv);
462
int attach_pool_data_lv(struct lv_segment *pool_seg,
463
struct logical_volume *pool_data_lv);
464
int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv,
465
struct logical_volume *origin_lv);
466
int detach_pool_lv(struct lv_segment *seg);
467
int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type,
468
struct logical_volume *lv, uint32_t delete_id,
470
int pool_has_message(const struct lv_segment *seg,
471
const struct logical_volume *lv, uint32_t device_id);
472
int pool_below_threshold(const struct lv_segment *pool_seg);
473
int extend_pool(struct logical_volume *lv, const struct segment_type *segtype,
474
struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size);
473
477
* Begin skeleton for external LVM library
475
479
struct id pv_id(const struct physical_volume *pv);