From fa37ed1a48fd804ac199509bd78c470480ecbb22 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Wed, 3 Jan 2018 14:16:19 +0300 Subject: [PATCH] common/throttle: start using 64-bit values Signed-off-by: Igor Fedotov --- src/common/Throttle.cc | 4 ++-- src/common/Throttle.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index 795e960e1ad..1e9aed5d36b 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 9081c006b77..d9efe5cc85e 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; -- 2.47.3