mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Move fields.
This commit is contained in:
parent
9a5e05a406
commit
2fc3a4576f
@ -400,6 +400,10 @@ static int _print_segment(struct formatter *f, struct volume_group *vg,
|
||||
_outf(f, "%s_count = %u%s", type, seg->area_count,
|
||||
(seg->area_count == 1) ? "\t# linear" : "");
|
||||
|
||||
if ((seg->type == SEG_MIRRORED) && (seg->status & PVMOVE))
|
||||
_out_size(f, (uint64_t) seg->extents_moved,
|
||||
"extents_moved = %u", seg->extents_moved);
|
||||
|
||||
if ((seg->type == SEG_STRIPED) && (seg->area_count > 1))
|
||||
_out_size(f, (uint64_t) seg->stripe_size,
|
||||
"stripe_size = %u", seg->stripe_size);
|
||||
|
@ -22,7 +22,7 @@ static struct flag _vg_flags[] = {
|
||||
{EXPORTED_VG, "EXPORTED"},
|
||||
{RESIZEABLE_VG, "RESIZEABLE"},
|
||||
{PARTIAL_VG, "PARTIAL"},
|
||||
{PVMOVE_VG, "PVMOVE"},
|
||||
{PVMOVE, "PVMOVE"},
|
||||
{LVM_READ, "READ"},
|
||||
{LVM_WRITE, "WRITE"},
|
||||
{CLUSTERED, "CLUSTERED"},
|
||||
@ -41,6 +41,8 @@ static struct flag _lv_flags[] = {
|
||||
{LVM_WRITE, "WRITE"},
|
||||
{FIXED_MINOR, "FIXED_MINOR"},
|
||||
{VISIBLE_LV, "VISIBLE"},
|
||||
{PVMOVE, "PVMOVE"},
|
||||
{LOCKED, "LOCKED"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
@ -1147,7 +1147,7 @@ static int _pv_read(const struct format_type *fmt, const char *pv_name,
|
||||
}
|
||||
|
||||
/* Perform full scan and try again */
|
||||
cache_label_scan(fmt->cmd, 0);
|
||||
cache_label_scan(fmt->cmd, 1);
|
||||
|
||||
if (info->vginfo && info->vginfo->vgname && *info->vginfo->vgname &&
|
||||
_get_pv_from_vg(info->fmt, info->vginfo->vgname, info->dev->pvid,
|
||||
|
@ -221,7 +221,7 @@ static int _read_segment(struct pool *mem, struct volume_group *vg,
|
||||
struct config_value *cv;
|
||||
const char *seg_name = sn->key;
|
||||
uint32_t start_extent, extent_count;
|
||||
uint32_t chunk_size;
|
||||
uint32_t chunk_size, extents_moved = 0u, seg_status = 0u;
|
||||
const char *org_name, *cow_name;
|
||||
struct logical_volume *org, *cow, *lv1;
|
||||
segment_type_t segtype;
|
||||
@ -267,6 +267,16 @@ static int _read_segment(struct pool *mem, struct volume_group *vg,
|
||||
"segment '%s'.", sn->key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (find_config_node(sn, "extents_moved", '/')) {
|
||||
if (_read_uint32(sn, "extents_moved", &extents_moved))
|
||||
seg_status |= PVMOVE;
|
||||
else {
|
||||
log_error("Couldn't read 'extents_moved' for "
|
||||
"segment '%s'.", sn->key);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(seg = pool_zalloc(mem, sizeof(*seg) +
|
||||
@ -280,6 +290,8 @@ static int _read_segment(struct pool *mem, struct volume_group *vg,
|
||||
seg->len = extent_count;
|
||||
seg->area_len = extent_count;
|
||||
seg->type = segtype;
|
||||
seg->status = seg_status;
|
||||
seg->extents_moved = extents_moved;
|
||||
|
||||
switch (segtype) {
|
||||
case SEG_SNAPSHOT:
|
||||
|
Loading…
Reference in New Issue
Block a user