[lvm-devel] [PATCH 08/15] lvm-merge-reporting
Mike Snitzer
snitzer at redhat.com
Fri Nov 20 22:35:48 UTC 2009
From: Mikulas Patocka <mpatocka at redhat.com>
Report merging snapshot as 'S' instead of 's':
This is useful for when the snapshot is still active and merging hasn't
started yet; it shows a merge is pending. Once merging starts the
merging snapshot will be hidden but can still be displayed with 'lvs -a'
Report snapshot origin with merging snapshot as 'O' instead of 'o':
Before merge starts this shows that a merge is pending. While merging
the snapshot will be hidden, 'O' enables a user to see that there is a
snapshot merging.
Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
Reviewed-by: Mike Snitzer <snitzer at redhat.com>
---
lib/report/report.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/lib/report/report.c b/lib/report/report.c
index 54192d5..9b3fd0d 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -314,8 +314,12 @@ static int _lvstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_
else if (lv->status & VIRTUAL)
repstr[0] = 'v';
/* Origin takes precedence over Mirror */
- else if (lv_is_origin(lv))
- repstr[0] = 'o';
+ else if (lv_is_origin(lv)) {
+ if (lv->merging_snapshot)
+ repstr[0] = 'O';
+ else
+ repstr[0] = 'o';
+ }
else if (lv->status & MIRRORED) {
if (lv->status & MIRROR_NOTSYNCED)
repstr[0] = 'M';
@@ -328,9 +332,12 @@ static int _lvstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_
repstr[0] = 'I';
else if (lv->status & MIRROR_LOG)
repstr[0] = 'l';
- else if (lv_is_cow(lv))
- repstr[0] = 's';
- else
+ else if (lv_is_cow(lv)) {
+ if (find_cow(lv)->status & SNAPSHOT_MERGE)
+ repstr[0] = 'S';
+ else
+ repstr[0] = 's';
+ } else
repstr[0] = '-';
if (lv->status & PVMOVE)
--
1.6.5.2
More information about the lvm-devel
mailing list