]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove set_latest_epoch from RGWPeriod::store_info
authorCasey Bodley <cbodley@redhat.com>
Tue, 2 May 2017 15:45:39 +0000 (11:45 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 23 Aug 2017 07:17:12 +0000 (09:17 +0200)
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 <cbodley@redhat.com>
(cherry picked from commit c1731dd2d3de5a337903004f835045d609a731cf)

Conflicts:
src/rgw/rgw_rados.cc (trivial resolution)

src/rgw/rgw_rados.cc

index 68f4ad5b76d9b2b2a266b475a195f40a7b2637d5..091a14c41ba98c23621f55c246fd5366d88a133e 100644 (file)
@@ -1143,12 +1143,6 @@ 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;
-  }
   string pool_name = get_pool_name(cct);
 
   rgw_bucket pool(pool_name.c_str());
@@ -1156,19 +1150,9 @@ int RGWPeriod::store_info(bool exclusive)
   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);
 }
 
 const string& RGWPeriod::get_pool_name(CephContext *cct)