[PATCH] Exabytes
authorJens Axboe <jens.axboe@oracle.com>
Wed, 14 Feb 2007 00:27:09 +0000 (01:27 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 14 Feb 2007 00:27:09 +0000 (01:27 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
init.c
parse.c
stat.c

diff --git a/init.c b/init.c
index f4125b13c5f05c1064d07d5e12bf72d5295a034e..f4a37401ec0b507eef3cc04252db1669be66457d 100644 (file)
--- a/init.c
+++ b/init.c
@@ -639,7 +639,7 @@ static void fixup_options(struct thread_data *td)
 static char *to_kmg(unsigned int val)
 {
        char *buf = malloc(32);
-       char post[] = { 0, 'K', 'M', 'G', 'P', 0 };
+       char post[] = { 0, 'K', 'M', 'G', 'P', 'E', 0 };
        char *p = post;
 
        do {
diff --git a/parse.c b/parse.c
index b09f20d714d4a8475dcaac682dbcf4ba0e385b36..7fb2bb6399cc564b038f6889a5f2fb3f603b5719 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -40,6 +40,9 @@ static unsigned long get_mult_bytes(char c)
                case 'g':
                case 'G':
                        return 1024 * 1024 * 1024;
+               case 'e':
+               case 'E':
+                       return 1024 * 1024 * 1024 * 1024UL;
                default:
                        return 1;
        }
diff --git a/stat.c b/stat.c
index bfdf390bcf5fac48a791be18898a3dbfe968eeef..f9c6985338d998095fd35a229d8b0be5ed533760 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -22,7 +22,7 @@ static char *num2str(unsigned long num, int maxlen, int base)
         * 2^10 base right now.
         */
        const unsigned int thousand = 1024;
-       char postfix[] = { 'K', 'M', 'G', 'P' };
+       char postfix[] = { 'K', 'M', 'G', 'P', 'E' };
        char *buf;
        int i;
 
@@ -47,7 +47,7 @@ static char *num2str(unsigned long num, int maxlen, int base)
                num /= thousand;
                num += carry;
                i++;
-       } while (i <= 4);
+       } while (i <= 5);
 
        return buf;
 }