diff --git a/WHATS_NEW b/WHATS_NEW index 4ffbe4f9a..efd83e68f 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.103 - ====================================== + Add seg_size_pe field to reports. Support start+length notation with command line PE ranges. Exit cleanly with message when pvmove cannot restart because LV is inactive. diff --git a/lib/report/columns.h b/lib/report/columns.h index 9bb99d389..6df977136 100644 --- a/lib/report/columns.h +++ b/lib/report/columns.h @@ -125,6 +125,7 @@ FIELD(SEGS, seg, NUM, "TransId", list, 4, transactionid, transaction_id, "For th FIELD(SEGS, seg, NUM, "Start", list, 5, segstart, seg_start, "Offset within the LV to the start of the segment in current units.", 0) FIELD(SEGS, seg, NUM, "Start", list, 5, segstartpe, seg_start_pe, "Offset within the LV to the start of the segment in physical extents.", 0) FIELD(SEGS, seg, NUM, "SSize", list, 5, segsize, seg_size, "Size of segment in current units.", 0) +FIELD(SEGS, seg, NUM, "SSize", list, 5, segsizepe, seg_size_pe, "Size of segment in physical extents.", 0) FIELD(SEGS, seg, STR, "Seg Tags", tags, 8, tags, seg_tags, "Tags, if any.", 0) FIELD(SEGS, seg, STR, "PE Ranges", list, 9, peranges, seg_pe_ranges, "Ranges of Physical Extents of underlying devices in command line format.", 0) FIELD(SEGS, seg, STR, "Devices", list, 7, devices, devices, "Underlying devices used with starting extent numbers.", 0) diff --git a/lib/report/properties.c b/lib/report/properties.c index 62a1a3510..56200f06f 100644 --- a/lib/report/properties.c +++ b/lib/report/properties.c @@ -315,6 +315,8 @@ GET_LVSEG_NUM_PROPERTY_FN(seg_start_pe, lvseg->le) #define _seg_start_pe_set prop_not_implemented_set GET_LVSEG_NUM_PROPERTY_FN(seg_size, (SECTOR_SIZE * lvseg_size(lvseg))) #define _seg_size_set prop_not_implemented_set +GET_LVSEG_NUM_PROPERTY_FN(seg_size_pe, lvseg->len) +#define _seg_size_pe_set prop_not_implemented_set GET_LVSEG_STR_PROPERTY_FN(seg_tags, lvseg_tags_dup(lvseg)) #define _seg_tags_set prop_not_implemented_set GET_LVSEG_STR_PROPERTY_FN(seg_pe_ranges, diff --git a/lib/report/report.c b/lib/report/report.c index 540181a9e..46edf5673 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -560,6 +560,17 @@ static int _segsize_disp(struct dm_report *rh, struct dm_pool *mem, return _size64_disp(rh, mem, field, &size, private); } +static int _segsizepe_disp(struct dm_report *rh, + struct dm_pool *mem __attribute__((unused)), + struct dm_report_field *field, + const void *data, + void *private __attribute__((unused))) +{ + const struct lv_segment *seg = (const struct lv_segment *) data; + + return dm_report_field_uint32(rh, field, &seg->len); +} + static int _chunksize_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, const void *data, void *private) diff --git a/man/lvs.8.in b/man/lvs.8.in index 32cb788e7..85f7d33fa 100644 --- a/man/lvs.8.in +++ b/man/lvs.8.in @@ -113,6 +113,7 @@ segtype, seg_count, seg_pe_ranges, seg_size, +seg_size_pe, seg_start, seg_start_pe, seg_tags,