From 5821a09bf723e1b82f0fce2e78f78e0b088353ed Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 30 Sep 2013 22:00:01 -0700 Subject: Use 'k' when printing 'kilo'; accept either 'K' or 'k' as input Fixes: #4612 Signed-off-by: Dan Mick --- src/common/util.cc | 1 + src/include/types.h | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/util.cc b/src/common/util.cc index 6da37e88833..ab417befef6 100644 --- a/src/common/util.cc +++ b/src/common/util.cc @@ -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; diff --git a/src/include/types.h b/src/include/types.h index 1f9756b22c7..5a9e6f6d4c9 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -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) -- cgit v1.2.1