diff mbox

[4/5] parse_size(): add new suffixes

Message ID 1351014715-5727-5-git-send-email-kreijack@inwind.com (mailing list archive)
State New, archived
Headers show

Commit Message

Goffredo Baroncelli Oct. 23, 2012, 5:51 p.m. UTC
From: Goffredo Baroncelli <kreijack@inwind.it>

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 .
---
 utils.c |    6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/utils.c b/utils.c
index e61cdea..4b16fc9 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':