summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-14 03:07:29 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-14 03:07:29 +0100
commit32895bb39049b7d5c244a2e4201f47077bfa8b12 (patch)
tree0a296fc8dd0ae0c157f5a5b2c86212365fac3380 /src
parenta7bc2c2ac8d26779ed1154841545e8c0efbef31c (diff)
util: support formatting eta and peta bytes with format_bytes()
Diffstat (limited to 'src')
-rw-r--r--src/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 7450565567..b6e490d457 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3077,6 +3077,8 @@ int parse_bytes(const char *t, off_t *bytes) {
{ "M", 1024ULL*1024ULL },
{ "G", 1024ULL*1024ULL*1024ULL },
{ "T", 1024ULL*1024ULL*1024ULL*1024ULL },
+ { "P", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
+ { "E", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
{ "", 1 },
};
@@ -6082,6 +6084,8 @@ char *format_bytes(char *buf, size_t l, off_t t) {
const char *suffix;
off_t factor;
} table[] = {
+ { "E", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
+ { "P", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
{ "T", 1024ULL*1024ULL*1024ULL*1024ULL },
{ "G", 1024ULL*1024ULL*1024ULL },
{ "M", 1024ULL*1024ULL },