From: Yehuda Sadeh Date: Sun, 13 Mar 2016 03:21:20 +0000 (-0800) Subject: rgw: timespan fix X-Git-Tag: v10.1.0~73^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f5f525243f23cc42e8924cc60227fbfc0f582caa;p=ceph.git rgw: timespan fix use make_timespan() to generate a correct timespan struct Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index dc7b1e80822a..685968cd66c1 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1360,7 +1360,7 @@ int RGWDataChangesLog::renew_entries() } real_time expiration = now; - expiration += timespan(cct->_conf->rgw_data_log_window); + expiration += make_timespan(cct->_conf->rgw_data_log_window); list& buckets = miter->second.first; list::iterator liter; @@ -1463,7 +1463,7 @@ int RGWDataChangesLog::add_entry(rgw_bucket& bucket, int shard_id) { status->cur_sent = now; expiration = now; - expiration += timespan(cct->_conf->rgw_data_log_window); + expiration += ceph::make_timespan(cct->_conf->rgw_data_log_window); status->lock->Unlock(); @@ -1494,7 +1494,7 @@ int RGWDataChangesLog::add_entry(rgw_bucket& bucket, int shard_id) { status->pending = false; status->cur_expiration = status->cur_sent; /* time of when operation started, not completed */ - status->cur_expiration += timespan(cct->_conf->rgw_data_log_window); + status->cur_expiration += make_timespan(cct->_conf->rgw_data_log_window); status->cond = NULL; status->lock->Unlock(); diff --git a/src/rgw/rgw_quota.cc b/src/rgw/rgw_quota.cc index 98e317e69fe1..0ea17d5e7e88 100644 --- a/src/rgw/rgw_quota.cc +++ b/src/rgw/rgw_quota.cc @@ -591,7 +591,7 @@ int RGWUserStatsCache::sync_user(const rgw_user& user) } real_time when_need_full_sync = header.last_stats_sync; - when_need_full_sync += timespan(store->ctx()->_conf->rgw_user_quota_sync_wait_time); + when_need_full_sync += make_timespan(store->ctx()->_conf->rgw_user_quota_sync_wait_time); // check if enough time passed since last full sync /* FIXME: missing check? */ diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index cc589d9a0c27..ed06c7591b9f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -9823,7 +9823,7 @@ void RGWRados::check_pending_olh_entries(map& pending_entrie map::iterator cur_iter = iter; ++iter; - if (now - pending_info.time >= timespan(cct->_conf->rgw_olh_pending_timeout_sec)) { + if (now - pending_info.time >= make_timespan(cct->_conf->rgw_olh_pending_timeout_sec)) { (*rm_pending_entries)[cur_iter->first] = cur_iter->second; pending_entries.erase(cur_iter); } else { @@ -11850,7 +11850,7 @@ int RGWOpStateSingleOp::renew_state() { int rate_limit_sec = cct->_conf->rgw_opstate_ratelimit_sec; - if (rate_limit_sec && now - last_update < timespan(rate_limit_sec)) { + if (rate_limit_sec && now - last_update < make_timespan(rate_limit_sec)) { return 0; } diff --git a/src/rgw/rgw_rest_log.cc b/src/rgw/rgw_rest_log.cc index f8bc6fde2d0c..0b32789a4f75 100644 --- a/src/rgw/rgw_rest_log.cc +++ b/src/rgw/rgw_rest_log.cc @@ -259,7 +259,7 @@ void RGWOp_MDLog_Lock::execute() { http_ret = -EINVAL; return; } - http_ret = meta_log.lock_exclusive(shard_id, timespan(dur), zone_id, + http_ret = meta_log.lock_exclusive(shard_id, make_timespan(dur), zone_id, locker_id); if (http_ret == -EBUSY) http_ret = -ERR_LOCKED; @@ -695,7 +695,7 @@ void RGWOp_DATALog_Lock::execute() { http_ret = -EINVAL; return; } - http_ret = store->data_log->lock_exclusive(shard_id, timespan(dur), zone_id, locker_id); + http_ret = store->data_log->lock_exclusive(shard_id, make_timespan(dur), zone_id, locker_id); if (http_ret == -EBUSY) http_ret = -ERR_LOCKED; } diff --git a/src/rgw/rgw_rest_metadata.cc b/src/rgw/rgw_rest_metadata.cc index 4f22a945dcae..8f02b0fbaa13 100644 --- a/src/rgw/rgw_rest_metadata.cc +++ b/src/rgw/rgw_rest_metadata.cc @@ -250,7 +250,7 @@ void RGWOp_Metadata_Lock::execute() { http_ret = -EINVAL; return; } - http_ret = store->meta_mgr->lock_exclusive(metadata_key, timespan(dur), lock_id); + http_ret = store->meta_mgr->lock_exclusive(metadata_key, make_timespan(dur), lock_id); if (http_ret == -EBUSY) http_ret = -ERR_LOCKED; } diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 0cf96b842454..8d6be83fc392 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -539,7 +539,7 @@ static int get_delete_at_param(req_state *s, real_time *delete_at) return -EINVAL; } - delat_proposal += timespan(ts); + delat_proposal += make_timespan(ts); if (delat_proposal < real_clock::now()) { return -EINVAL; }