diff options
author | Dan Mick <dan.mick@inktank.com> | 2013-09-30 22:00:01 -0700 |
---|---|---|
committer | Dan Mick <dan.mick@inktank.com> | 2013-09-30 22:04:54 -0700 |
commit | 5821a09bf723e1b82f0fce2e78f78e0b088353ed (patch) | |
tree | baefcdff8da1b09ed67c8bfe350ca36202b92554 | |
parent | 56711370c3a7dfce683f73f1f4b7b5ccd66cbeb5 (diff) | |
download | ceph-5821a09bf723e1b82f0fce2e78f78e0b088353ed.tar.gz |
Use 'k' when printing 'kilo'; accept either 'K' or 'k' as inputwip-4612
Fixes: #4612
Signed-off-by: Dan Mick <dan.mick@inktank.com>
-rw-r--r-- | src/common/util.cc | 1 | ||||
-rw-r--r-- | 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) |