Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
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 {
case 'g':
case 'G':
return 1024 * 1024 * 1024;
+ case 'e':
+ case 'E':
+ return 1024 * 1024 * 1024 * 1024UL;
default:
return 1;
}
* 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;
num /= thousand;
num += carry;
i++;
- } while (i <= 4);
+ } while (i <= 5);
return buf;
}