parse_size(): add new suffixes
authorGoffredo Baroncelli <kreijack@gmail.com>
Mon, 29 Oct 2012 17:53:19 +0000 (18:53 +0100)
committerDavid Sterba <dsterba@suse.cz>
Thu, 17 Jan 2013 17:27:54 +0000 (18:27 +0100)
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>
utils.c

diff --git a/utils.c b/utils.c
index aa2e574..b487be6 100644 (file)
--- 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':