summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorGoffredo Baroncelli <kreijack@gmail.com>2012-10-29 18:53:19 +0100
committerDavid Sterba <dsterba@suse.cz>2013-01-17 18:27:54 +0100
commit9495b4d228cb11773ba223228e6ea11f486b28e1 (patch)
tree5728d5400709592919031ecce684a1b5b749a0a2 /utils.c
parent631886760203135f6cedb861466604e428217c71 (diff)
parse_size(): add new suffixes
Add new suffixes in parse_size() function. New suffixes are: T as terabyte, P as petabyte, E as exabyte. Note these units are multiply of 2 . Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index aa2e574a..b487be61 100644
--- a/utils.c
+++ b/utils.c
@@ -1236,6 +1236,12 @@ u64 parse_size(char *s)
if (s[i]) {
c = tolower(s[i]);
switch (c) {
+ case 'e':
+ mult *= 1024;
+ case 'p':
+ mult *= 1024;
+ case 't':
+ mult *= 1024;
case 'g':
mult *= 1024;
case 'm':