Merge pull request #13 from bgilbert/fix-units

thin_metadata_size: Fix long names of units
This commit is contained in:
Joe Thornber
2014-08-05 09:34:37 +01:00
3 changed files with 20 additions and 20 deletions

8
thin-provisioning/thin_metadata_size.c Executable file → Normal file
View File

@@ -111,10 +111,10 @@ static struct global *init_prg(char *prg_path)
unsigned u;
static char *unit_chars = "bskKmMgGtTpPeEzZyY";
static char *unit_strings[] = { "bytes", "sectors",
"kilobytes", "kibibytes", "megabytes", "mebibytes",
"gigabytes", "gibibytes", "terabytes", "tebibytes",
"petabytes", "pebibytes", "exabytes", "ebibytes",
"zetabytes", "zebibytes", "yottabytes", "yobibytes", NULL };
"kibibytes", "kilobytes", "mebibytes", "megabytes",
"gibibytes", "gigabytes", "tebibytes", "terabytes",
"pebibytes", "petabytes", "ebibytes", "exabytes",
"zebibytes", "zetabytes", "yobibytes", "yottabytes", NULL };
static unsigned long long unit_factors[ARRAY_SIZE(unit_strings) - 1] = { 1, 512, 1024, 1000 };
struct global *r = malloc(sizeof(*r));

View File

@@ -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