diff --git a/lib/report/columns.h b/lib/report/columns.h index 6299a2bb5..c83a086d3 100644 --- a/lib/report/columns.h +++ b/lib/report/columns.h @@ -78,7 +78,8 @@ FIELD(LVS, lv, NUM, "OSize", lvid, 5, originsize, origin_size, "For snapshots, t FIELD(LVS, lv, NUM, "Data%", lvid, 6, datapercent, data_percent, "For snapshot and thin pools and volumes, the percentage full if LV is active.", 0) FIELD(LVS, lv, NUM, "Snap%", lvid, 6, snpercent, snap_percent, "For snapshots, the percentage full if LV is active.", 0) FIELD(LVS, lv, NUM, "Meta%", lvid, 6, metadatapercent, metadata_percent, "For thin pools, the percentage of metadata full if LV is active.", 0) -FIELD(LVS, lv, NUM, "Copy%", lvid, 6, copypercent, copy_percent, "For mirrors and pvmove, current percentage in-sync.", 0) +FIELD(LVS, lv, NUM, "Cpy%Sync", lvid, 8, copypercent, copy_percent, "For RAID, mirrors and pvmove, current percentage in-sync.", 0) +FIELD(LVS, lv, NUM, "Cpy%Sync", lvid, 8, copypercent, sync_percent, "For RAID, mirrors and pvmove, current percentage in-sync.", 0) FIELD(LVS, lv, STR, "Move", lvid, 4, movepv, move_pv, "For pvmove, Source PV of temporary LV created by pvmove.", 0) FIELD(LVS, lv, STR, "Convert", lvid, 7, convertlv, convert_lv, "For lvconvert, Name of temporary LV created by lvconvert.", 0) FIELD(LVS, lv, STR, "Log", lvid, 3, loglv, mirror_log, "For mirrors, the LV holding the synchronisation log.", 0) diff --git a/lib/report/properties.c b/lib/report/properties.c index c4f6ab985..fe197f56b 100644 --- a/lib/report/properties.c +++ b/lib/report/properties.c @@ -189,6 +189,8 @@ GET_LV_NUM_PROPERTY_FN(snap_percent, _snap_percent(lv)) #define _snap_percent_set _not_implemented_set GET_LV_NUM_PROPERTY_FN(copy_percent, _copy_percent(lv)) #define _copy_percent_set _not_implemented_set +GET_LV_NUM_PROPERTY_FN(sync_percent, _copy_percent(lv)) +#define _sync_percent_set _not_implemented_set GET_LV_STR_PROPERTY_FN(move_pv, lv_move_pv_dup(lv->vg->vgmem, lv)) #define _move_pv_set _not_implemented_set GET_LV_STR_PROPERTY_FN(convert_lv, lv_convert_lv_dup(lv->vg->vgmem, lv)) diff --git a/lib/report/report.c b/lib/report/report.c index b1e2bc1ea..18334588f 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -898,13 +898,14 @@ static int _copypercent_disp(struct dm_report *rh __attribute__((unused)), return 0; } - if ((!(lv->status & PVMOVE) && !(lv->status & MIRRORED)) || - !lv_mirror_percent(lv->vg->cmd, lv, 0, &percent, - NULL) || (percent == PERCENT_INVALID)) { - *sortval = UINT64_C(0); - dm_report_field_set_value(field, "", sortval); - return 1; - } + if (lv->status & RAID) { + if (!lv_raid_percent(lv, &percent) || + (percent == PERCENT_INVALID)) + goto no_copypercent; + } else if ((!(lv->status & PVMOVE) && !(lv->status & MIRRORED)) || + !lv_mirror_percent(lv->vg->cmd, lv, 0, &percent, NULL) || + (percent == PERCENT_INVALID)) + goto no_copypercent; percent = copy_percent(lv); @@ -922,6 +923,11 @@ static int _copypercent_disp(struct dm_report *rh __attribute__((unused)), dm_report_field_set_value(field, repstr, sortval); return 1; + +no_copypercent: + *sortval = UINT64_C(0); + dm_report_field_set_value(field, "", sortval); + return 1; } static int _dtpercent_disp(int metadata, struct dm_report *rh, diff --git a/man/lvs.8.in b/man/lvs.8.in index f31256cc3..d4d77b0fb 100644 --- a/man/lvs.8.in +++ b/man/lvs.8.in @@ -113,6 +113,7 @@ seg_tags, snap_percent, stripes, stripe_size, +sync_percent, thin_count, transaction_id, zero.