]> err.no Git - systemd/commitdiff
util: support formatting eta and peta bytes with format_bytes()
authorLennart Poettering <lennart@poettering.net>
Sat, 14 Jan 2012 02:07:29 +0000 (03:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 14 Jan 2012 02:07:29 +0000 (03:07 +0100)
src/util.c

index 7450565567bf8036affcfe11efea7235d59b12a1..b6e490d457a3562ad1e97037bdd9fbe7a9687bd9 100644 (file)
@@ -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 },