From: Igor Fedotov Date: Wed, 3 Jan 2018 11:16:19 +0000 (+0300) Subject: common/throttle: start using 64-bit values X-Git-Tag: v13.0.2~570^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa37ed1a48fd804ac199509bd78c470480ecbb22;p=ceph.git common/throttle: start using 64-bit values Signed-off-by: Igor Fedotov --- diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index 795e960e1ad6..1e9aed5d36ba 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -76,7 +76,7 @@ Throttle::~Throttle() void Throttle::_reset_max(int64_t m) { // lock must be held. - if (static_cast(max) == m) + if (max == m) return; if (!conds.empty()) conds.front().notify_one(); @@ -222,7 +222,7 @@ int64_t Throttle::put(int64_t c) if (!conds.empty()) conds.front().notify_one(); // if count goes negative, we failed somewhere! - assert(static_cast(count) >= c); + assert(count >= c); count -= c; if (logger) { logger->inc(l_throttle_put); diff --git a/src/common/Throttle.h b/src/common/Throttle.h index 9081c006b774..d9efe5cc85e3 100644 --- a/src/common/Throttle.h +++ b/src/common/Throttle.h @@ -29,7 +29,7 @@ class Throttle { CephContext *cct; const std::string name; PerfCountersRef logger; - std::atomic count = { 0 }, max = { 0 }; + std::atomic count = { 0 }, max = { 0 }; std::mutex lock; std::list conds; const bool use_perf;