]> sourceware.org Git - lvm2.git/commitdiff
Report merging snapshot as 'S' instead of 's':
authorMike Snitzer <snitzer@redhat.com>
Wed, 13 Jan 2010 01:48:38 +0000 (01:48 +0000)
committerMike Snitzer <snitzer@redhat.com>
Wed, 13 Jan 2010 01:48:38 +0000 (01:48 +0000)
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.

lib/report/report.c
man/lvs.8.in

index 31e31745d9adafc45164a076be1243a96415f9d6..b2e32dbbeb2bcbc00e75c3b2095f38dd9b4deba0 100644 (file)
@@ -305,8 +305,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';
@@ -319,9 +323,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)
index 06c27c08bd65cbdb2d17390750968cb57fd53e20..1c4bcc43eb8528905cc19a40dd1d1e13dc1f1b4f 100644 (file)
@@ -68,9 +68,9 @@ can also be chosen.
 The lv_attr bits are: 
 .RS
 .IP 1 3
-Volume type: (m)irrored, (M)irrored without initial sync, (o)rigin, (p)vmove,
-(s)napshot, invalid (S)napshot, (v)irtual, mirror (i)mage, mirror (I)mage
-out-of-sync, under (c)onversion
+Volume type: (m)irrored, (M)irrored without initial sync, (o)rigin,
+(O)rigin with merging snapshot, (s)napshot, merging (S)napshot, (p)vmove,
+(v)irtual, mirror (i)mage, mirror (I)mage out-of-sync, under (c)onversion
 .IP 2 3
 Permissions: (w)riteable, (r)ead-only
 .IP 3 3
This page took 0.034775 seconds and 5 git commands to generate.