Signed-off-by: Igor Fedotov <ifedotov@suse.com>
void Throttle::_reset_max(int64_t m)
{
// lock must be held.
- if (static_cast<int64_t>(max) == m)
+ if (max == m)
return;
if (!conds.empty())
conds.front().notify_one();
if (!conds.empty())
conds.front().notify_one();
// if count goes negative, we failed somewhere!
- assert(static_cast<int64_t>(count) >= c);
+ assert(count >= c);
count -= c;
if (logger) {
logger->inc(l_throttle_put);
CephContext *cct;
const std::string name;
PerfCountersRef logger;
- std::atomic<unsigned> count = { 0 }, max = { 0 };
+ std::atomic<int64_t> count = { 0 }, max = { 0 };
std::mutex lock;
std::list<std::condition_variable> conds;
const bool use_perf;