mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
snapshot: use seg_status for attrs
This commit is contained in:
parent
92eba53a79
commit
80603ad49a
@ -1111,7 +1111,6 @@ int lv_raid_healthy(const struct logical_volume *lv)
|
|||||||
|
|
||||||
char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_with_info_and_seg_status *lvdm)
|
char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_with_info_and_seg_status *lvdm)
|
||||||
{
|
{
|
||||||
dm_percent_t snap_percent;
|
|
||||||
const struct logical_volume *lv = lvdm->lv;
|
const struct logical_volume *lv = lvdm->lv;
|
||||||
struct lv_segment *seg;
|
struct lv_segment *seg;
|
||||||
char *repstr;
|
char *repstr;
|
||||||
@ -1203,19 +1202,18 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_
|
|||||||
repstr[4] = 'd'; /* Inactive without table */
|
repstr[4] = 'd'; /* Inactive without table */
|
||||||
|
|
||||||
/* Snapshot dropped? */
|
/* Snapshot dropped? */
|
||||||
if (lvdm->info.live_table && lv_is_cow(lv)) {
|
if (lvdm->info.live_table &&
|
||||||
if (!lv_snapshot_percent(lv, &snap_percent) ||
|
(lvdm->seg_status.type == SEG_STATUS_SNAPSHOT)) {
|
||||||
snap_percent == DM_PERCENT_INVALID) {
|
if (lvdm->seg_status.snapshot->invalid) {
|
||||||
if (lvdm->info.suspended)
|
if (lvdm->info.suspended)
|
||||||
repstr[4] = 'S'; /* Susp Inv snapshot */
|
repstr[4] = 'S'; /* Susp Inv snapshot */
|
||||||
else
|
else
|
||||||
repstr[4] = 'I'; /* Invalid snapshot */
|
repstr[4] = 'I'; /* Invalid snapshot */
|
||||||
}
|
} else if (lvdm->seg_status.snapshot->merge_failed) {
|
||||||
else if (snap_percent == LVM_PERCENT_MERGE_FAILED) {
|
|
||||||
if (lvdm->info.suspended)
|
if (lvdm->info.suspended)
|
||||||
repstr[4] = 'M'; /* Susp snapshot merge failed */
|
repstr[4] = 'M'; /* Susp snapshot merge failed */
|
||||||
else
|
else
|
||||||
repstr[4] = 'm'; /* snapshot merge failed */
|
repstr[4] = 'm'; /* Snapshot merge failed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user