From: Casey Bodley Date: Tue, 2 May 2017 13:47:57 +0000 (-0400) Subject: rgw: period latest_epoch ops take optional objv tracker X-Git-Tag: v12.1.1~21^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b855c39656d7556c7895850d12177ca6c1db01af;p=ceph.git rgw: period latest_epoch ops take optional objv tracker Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 57bd608706e7..bc06c6b99fde 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1120,14 +1120,15 @@ const string RGWPeriod::get_period_oid() return oss.str(); } -int RGWPeriod::read_latest_epoch(RGWPeriodLatestEpochInfo& info) +int RGWPeriod::read_latest_epoch(RGWPeriodLatestEpochInfo& info, + RGWObjVersionTracker *objv) { string oid = get_period_oid_prefix() + get_latest_epoch_oid(); rgw_pool pool(get_pool(cct)); bufferlist bl; RGWObjectCtx obj_ctx(store); - int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL); + int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, objv, nullptr); if (ret < 0) { ldout(cct, 1) << "error read_lastest_epoch " << pool << ":" << oid << dendl; return ret; @@ -1170,7 +1171,8 @@ int RGWPeriod::use_latest_epoch() return 0; } -int RGWPeriod::set_latest_epoch(epoch_t epoch, bool exclusive) +int RGWPeriod::set_latest_epoch(epoch_t epoch, bool exclusive, + RGWObjVersionTracker *objv) { string oid = get_period_oid_prefix() + get_latest_epoch_oid(); @@ -1183,7 +1185,7 @@ int RGWPeriod::set_latest_epoch(epoch_t epoch, bool exclusive) ::encode(info, bl); return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), - exclusive, NULL, real_time(), NULL); + exclusive, objv, real_time(), nullptr); } int RGWPeriod::delete_obj() diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 1beb753e2aae..302560885c62 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1807,7 +1807,8 @@ class RGWPeriod RGWRados *store; int read_info(); - int read_latest_epoch(RGWPeriodLatestEpochInfo& epoch_info); + int read_latest_epoch(RGWPeriodLatestEpochInfo& epoch_info, + RGWObjVersionTracker *objv = nullptr); int use_latest_epoch(); int use_current_period(); @@ -1872,7 +1873,8 @@ public: bool is_single_zonegroup(CephContext *cct, RGWRados *store); int get_latest_epoch(epoch_t& epoch); - int set_latest_epoch(epoch_t epoch, bool exclusive = false); + int set_latest_epoch(epoch_t epoch, bool exclusive = false, + RGWObjVersionTracker *objv = nullptr); int init(CephContext *_cct, RGWRados *_store, const string &period_realm_id, const string &period_realm_name = "", bool setup_obj = true);