Signed-off-by: Orit Wasserman <owasserm@redhat.com>
return cct->_conf->rgw_period_root_pool;
}
+int RGWPeriod::use_next_epoch()
+{
+ epoch_t latest_epoch;
+ int ret = get_latest_epoch(latest_epoch);
+ if (ret < 0) {
+ return ret;
+ }
+ epoch = latest_epoch + 1;
+ ret = read_info();
+ if (ret < 0 && ret != -ENOENT) {
+ return ret;
+ }
+ if (ret == -ENOENT) {
+ ret = create();
+ if (ret < 0) {
+ derr << "Error creating new epoch " << epoch << dendl;
+ return ret;
+ }
+ }
+ return 0;
+}
+
int RGWZoneParams::create_default(bool old_format)
{
name = default_zone_name;
int get_latest_epoch(epoch_t& epoch);
int init(const string &period_realm_id = "", const string &realm_name = "", bool setup_obj = true);
int init(const string& period_id, epoch_t epoch = 0, bool setup_obj = true);
+ int use_next_epoch();
+
int create();
int delete_obj();
int store_info(bool exclusive);
int activate() { return -ENOTSUP;}
-
+
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
::encode(id, bl);