]> sourceware.org Git - lvm2.git/commitdiff
Continue to make --units and --size consistent (in code and man pages):
authorsnitzer <snitzer>
Tue, 7 Jul 2009 19:28:57 +0000 (19:28 +0000)
committersnitzer <snitzer>
Tue, 7 Jul 2009 19:28:57 +0000 (19:28 +0000)
Update units_to_bytes() to support (S)ectors: 500 bytes.
- 500 byte (S)ectors is of questionable value but it adds to consistency
  if a user happens to use --units S.  This seems better than an error.

Updated test/t-covercmd.sh to test --units [hS]

Document the units that can be displayed via --units uniformly.
- (p)etabytes and (e)xabytes were missing in pvs, vgs and lvs man pages.

Made lvreduce man page "... in units of megabytes." consistent (with the
lvextend and lvresize man pages).

lib/display/display.c
man/lvreduce.8.in
man/lvs.8.in
man/pvs.8.in
man/vgs.8.in
test/t-covercmd.sh

index 0de0a8e8db4b525f85ab0f5edcbe696d5d2de0cc..15b13fc344f1684d5a349120e6b72f2ca7d43091 100644 (file)
@@ -62,14 +62,14 @@ uint64_t units_to_bytes(const char *units, char *unit_type)
                v = UINT64_C(1);
                *unit_type = *units;
                break;
-       case 's':
-               v *= SECTOR_SIZE;
-               break;
        case 'b':
        case 'B':
                v *= UINT64_C(1);
                break;
 #define KILO UINT64_C(1024)
+       case 's':
+               v *= (KILO/2);
+               break;
        case 'k':
                v *= KILO;
                break;
@@ -90,6 +90,9 @@ uint64_t units_to_bytes(const char *units, char *unit_type)
                break;
 #undef KILO
 #define KILO UINT64_C(1000)
+       case 'S':
+               v *= (KILO/2);
+               break;
        case 'K':
                v *= KILO;
                break;
index 1f98279614df95e60dbc9bf5f211ded56724157f..bb370aeb8e31a86bd16f2ae65ed469c575fec85d 100644 (file)
@@ -47,7 +47,7 @@ size of the Logical Volume with the suffix %LV or as a percentage of the remaini
 free space in the Volume Group with the suffix %FREE.
 .TP
 .I \-L, \-\-size [\-]LogicalVolumeSize[bBsSkKmMgGtTpPeE]
-Reduce or set the logical volume size in units of megabyte by default.
+Reduce or set the logical volume size in units of megabytes.
 A size suffix of k for kilobyte, m for megabyte, 
 g for gigabytes, t for terabytes, p for petabytes 
 or e for exabytes is optional.
index b566af6ef0bc689c78103a8143ab018e4d9b18ab..ff37a99db9c05600f3879bdfa735c4a1b4028afe 100644 (file)
@@ -9,7 +9,7 @@ lvs \- report information about logical volumes
 [\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]]
 [\-P|\-\-partial] [\-\-rows] [\-\-segments]
 [\-\-separator Separator] [\-\-unbuffered]
-[\-\-units hsbkmgtHKMGT]
+[\-\-units hHbBsSkKmMgGtTpPeE]
 [\-\-unquoted]
 [\-v|\-\-verbose] 
 [\-\-version] [VolumeGroupName [VolumeGroupName...]]
@@ -91,11 +91,11 @@ String to use to separate each column.  Useful if grepping the output.
 .I \-\-unbuffered
 Produce output immediately without sorting or aligning the columns properly.
 .TP
-.I \-\-units hsbkmgtHKMGT
-All sizes are output in these units: (h)uman-readable, (s)ectors, (b)ytes,
-(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes.  Capitalise to use multiples
-of 1000 (S.I.) instead of 1024.  Can also specify custom (u)nits e.g.
-\-\-units 3M
+.I \-\-units hHbBsSkKmMgGtTpPeE
+All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,
+(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.  
+Capitalise to use multiples of 1000 (S.I.) instead of 1024.  Can also specify 
+custom units e.g. \-\-units 3M
 .TP
 .I \-\-unquoted
 When used with --nameprefixes, output values in the field=value pairs are not quoted.
index 45e418ac9604b40ac07725a84068f2c87b805132..6bd693f41829504ebe32124b2360cfa2b4b86d69 100644 (file)
@@ -9,7 +9,7 @@ pvs \- report information about physical volumes
 [\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]]
 [\-\-rows] [\-\-segments]
 [\-\-separator Separator] [\-\-unbuffered]
-[\-\-units hsbkmgtHKMGT]
+[\-\-units hHbBsSkKmMgGtTpPeE]
 [\-\-unquoted]
 [\-v|\-\-verbose] 
 [\-\-version] [PhysicalVolume [PhysicalVolume...]]
@@ -69,11 +69,11 @@ String to use to separate each column.  Useful if grepping the output.
 .I \-\-unbuffered
 Produce output immediately without sorting or aligning the columns properly.
 .TP
-.I \-\-units hsbkmgtHKMGT
-All sizes are output in these units: (h)uman-readable, (s)ectors, (b)ytes,
-(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes.  Capitalise to use multiples
-of 1000 (S.I.) instead of 1024.  Can also specify custom (u)nits e.g.
-\-\-units 3M
+.I \-\-units hHbBsSkKmMgGtTpPeE
+All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,
+(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.  
+Capitalise to use multiples of 1000 (S.I.) instead of 1024.  Can also specify 
+custom units e.g. \-\-units 3M
 .TP
 .I \-\-unquoted
 When used with --nameprefixes, output values in the field=value pairs are not quoted.
index 7df9f285d66f9193bee3abaf499ac0cc71f4e477..c05a05a9f9a85539b04acbc5dc5980316f2305da 100644 (file)
@@ -9,7 +9,7 @@ vgs \- report information about volume groups
 [\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]]
 [\-P|\-\-partial] [\-\-rows]
 [\-\-separator Separator] [\-\-unbuffered]
-[\-\-units hsbkmgtHKMGT]
+[\-\-units hHbBsSkKmMgGtTpPeE]
 [\-\-unquoted]
 [\-v|\-\-verbose] 
 [\-\-version] [VolumeGroupName [VolumeGroupName...]]
@@ -80,11 +80,11 @@ String to use to separate each column.  Useful if grepping the output.
 .I \-\-unbuffered
 Produce output immediately without sorting or aligning the columns properly.
 .TP
-.I \-\-units hsbkmgtHKMGT
-All sizes are output in these units: (h)uman-readable, (s)ectors, (b)ytes,
-(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes.  Capitalise to use multiples
-of 1000 (S.I.) instead of 1024.  Can also specify custom (u)nits e.g.
-\-\-units 3M
+.I \-\-units hHbBsSkKmMgGtTpPeE
+All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,
+(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.  
+Capitalise to use multiples of 1000 (S.I.) instead of 1024.  Can also specify 
+custom units e.g. \-\-units 3M
 .TP
 .I \-\-unquoted
 When used with --nameprefixes, output values in the field=value pairs are not quoted.
index ed191bc7bc0761bba7adaa9c1d178eae9b4c24b1..d3aa19c1aa65672386a0991684ea46644a13e3fd 100755 (executable)
@@ -41,7 +41,7 @@ lvscan
 lvmdiskscan
 vgdisplay --units k
 lvdisplay --units g
-for i in b k m g t p e H B K M G T P E ; do
+for i in h b s k m g t p e H B S K M G T P E ; do
     pvdisplay --units "$i" "$dev1"
 done
 
This page took 0.051642 seconds and 5 git commands to generate.