thin_metadata_size: Fix long names of units
Both implementations of thin_metadata_size believe units are defined
like this:
1024 == kilobyte == k
1000 == kibibyte == K
and so on. Fix the 1000/1024 confusion, while continuing to follow the
LVM convention of using lowercase letters for binary units, so that we
have:
1024 == kibibyte == k
1000 == kilobyte == K
This commit is contained in:
@@ -22,10 +22,10 @@ def init_units
|
||||
units[:bytes_per_sector] = 512
|
||||
units[:chars] = "bskKmMgGtTpPeEzZyY"
|
||||
units[:strings] = [ 'bytes', 'sectors',
|
||||
'kilobytes', 'kibibytes', 'megabytes', 'mebibytes',
|
||||
'gigabytes', 'gibibytes', 'terabytes', 'tebibytes',
|
||||
'petabytes', 'pebibytes', 'exabytes', 'ebibytes',
|
||||
'zetabytes', 'zebibytes', 'yottabytes', 'yobibytes' ]
|
||||
'kibibytes', 'kilobytes', 'mebibytes', 'megabytes',
|
||||
'gibibytes', 'gigabytes', 'tebibytes', 'terabytes',
|
||||
'pebibytes', 'petabytes', 'ebibytes', 'exabytes',
|
||||
'zebibytes', 'zetabytes', 'yobibytes', 'yottabytes' ]
|
||||
units[:factors] = [ 1, units[:bytes_per_sector] ]
|
||||
1.step(8) { |e| units[:factors] += [ 1024**e, 1000**e ] }
|
||||
units
|
||||
|
||||
Reference in New Issue
Block a user