]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Use 'k' when printing 'kilo'; accept either 'K' or 'k' as input
authorDan Mick <dan.mick@inktank.com>
Tue, 1 Oct 2013 05:00:01 +0000 (22:00 -0700)
committerSage Weil <sage@inktank.com>
Tue, 1 Oct 2013 17:50:08 +0000 (10:50 -0700)
Fixes: #4612
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/common/util.cc
src/include/types.h

index 6da37e8883330a45c6227eee5df64e19a71edc16..ab417befef691ea8ab8f0d6670d45d5b4b1dedf1 100644 (file)
@@ -58,6 +58,7 @@ int64_t unit_to_bytesize(string val, ostream *pss)
     switch (c) {
     case 'B':
       break;
+    case 'k':
     case 'K':
       modifier = 10;
       break;
index 1f9756b22c7739344e5882c2a3e9508b97237148..5a9e6f6d4c9dd2a34f55a36b9ad50fc36583f901 100644 (file)
@@ -379,7 +379,7 @@ inline ostream& operator<<(ostream& out, const prettybyte_t& b)
   if (b.v > bump_after << 20)
     return out << (b.v >> 20) << " MB";    
   if (b.v > bump_after << 10)
-    return out << (b.v >> 10) << " KB";
+    return out << (b.v >> 10) << " kB";
   return out << b.v << " bytes";
 }
 
@@ -402,7 +402,7 @@ inline ostream& operator<<(ostream& out, const si_t& b)
   if (b.v > bump_after << 20)
     return out << (b.v >> 20) << "M";
   if (b.v > bump_after << 10)
-    return out << (b.v >> 10) << "K";
+    return out << (b.v >> 10) << "k";
   return out << b.v;
 }
 
@@ -425,7 +425,7 @@ inline ostream& operator<<(ostream& out, const pretty_si_t& b)
   if (b.v > bump_after << 20)
     return out << (b.v >> 20) << " M";
   if (b.v > bump_after << 10)
-    return out << (b.v >> 10) << " K";
+    return out << (b.v >> 10) << " k";
   return out << b.v << " ";
 }
 
@@ -445,7 +445,7 @@ inline ostream& operator<<(ostream& out, const kb_t& kb)
     return out << (kb.v >> 20) << " GB";    
   if (kb.v > bump_after << 10)
     return out << (kb.v >> 10) << " MB";
-  return out << kb.v << " KB";
+  return out << kb.v << " kB";
 }
 
 inline ostream& operator<<(ostream& out, const ceph_mon_subscribe_item& i)