From: Casey Bodley Date: Tue, 2 May 2017 15:45:39 +0000 (-0400) Subject: rgw: remove set_latest_epoch from RGWPeriod::store_info X-Git-Tag: v12.1.1~21^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1731dd2d3de5a337903004f835045d609a731cf;p=ceph.git rgw: remove set_latest_epoch from RGWPeriod::store_info split the latest_epoch update out of RGWPeriod::store_info(), so callers that need to call the atomic update_latest_epoch() can do so and interpret its result separately Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index d19e7606dc1d..c83eb51339e2 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1312,31 +1312,14 @@ int RGWPeriod::create(bool exclusive) int RGWPeriod::store_info(bool exclusive) { - epoch_t latest_epoch = FIRST_EPOCH - 1; - int ret = get_latest_epoch(latest_epoch); - if (ret < 0 && ret != -ENOENT) { - ldout(cct, 0) << "ERROR: RGWPeriod::get_latest_epoch() returned " << cpp_strerror(-ret) << dendl; - return ret; - } - rgw_pool pool(get_pool(cct)); string oid = get_period_oid(); bufferlist bl; ::encode(*this, bl); - ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL); - if (ret < 0) { - ldout(cct, 0) << "ERROR: rgw_put_system_obj(" << pool << ":" << oid << "): " << cpp_strerror(-ret) << dendl; - return ret; - } - if (latest_epoch < epoch) { - ret = set_latest_epoch(epoch); - if (ret < 0) { - ldout(cct, 0) << "ERROR: RGWPeriod::set_latest_epoch() returned " << cpp_strerror(-ret) << dendl; - return ret; - } - } - return 0; + + return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), + exclusive, NULL, real_time(), NULL); } rgw_pool RGWPeriod::get_pool(CephContext *cct)