]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: timespan fix
authorYehuda Sadeh <yehuda@redhat.com>
Sun, 13 Mar 2016 03:21:20 +0000 (19:21 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 15 Mar 2016 04:44:41 +0000 (21:44 -0700)
use make_timespan() to generate a correct timespan struct

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_quota.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rest_log.cc
src/rgw/rgw_rest_metadata.cc
src/rgw/rgw_rest_swift.cc

index dc7b1e80822a7722d00ed4b7d7c6cb34c55f1492..685968cd66c17ef071ab43fcecd88f1c9ea429e5 100644 (file)
@@ -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<rgw_bucket_shard>& buckets = miter->second.first;
     list<rgw_bucket_shard>::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();
 
index 98e317e69fe129d5e7549f63e51e6c5ffe27415b..0ea17d5e7e889fa6e8177ad329a3ad709e190a46 100644 (file)
@@ -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? */
index cc589d9a0c27aab45f4990441dddbdcbef07702f..ed06c7591b9f6a9235f83254183a3db0c4fc610c 100644 (file)
@@ -9823,7 +9823,7 @@ void RGWRados::check_pending_olh_entries(map<string, bufferlist>& pending_entrie
 
     map<string, bufferlist>::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;
   }
 
index f8bc6fde2d0ca76be54f6d895a4345633c0eaae0..0b32789a4f75dc954253673ca8578ef0e23313c0 100644 (file)
@@ -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;
 }
index 4f22a945dcaedc5b7c806ec83fa4e9fc9aef9cfd..8f02b0fbaa13a4f835d9bd08553885776fb8e38f 100644 (file)
@@ -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;
 }
index 0cf96b8424540f807117aa030dd6ca16ed63d9cd..8d6be83fc392af19a1385de675804690b80f1c6c 100644 (file)
@@ -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;
   }