From 10b8b57d723971604cbabf984291232c194a55ec Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Mon, 6 May 2019 23:08:48 +0300 Subject: [PATCH] rgw/pubsub: revert the RGWSysObjectCtx change Signed-off-by: Yuval Lifshitz --- src/rgw/rgw_pubsub.h | 2 +- src/rgw/rgw_tools.cc | 33 --------------------------------- src/rgw/rgw_tools.h | 2 -- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/rgw/rgw_pubsub.h b/src/rgw/rgw_pubsub.h index 056cd4fa69b..3fd7e91b7e7 100644 --- a/src/rgw/rgw_pubsub.h +++ b/src/rgw/rgw_pubsub.h @@ -621,7 +621,7 @@ int RGWUserPubSub::write(const rgw_raw_obj& obj, const T& info, RGWObjVersionTra bufferlist bl; encode(info, bl); - int ret = rgw_put_system_obj(store, obj_ctx, obj.pool, obj.oid, + int ret = rgw_put_system_obj(store, obj.pool, obj.oid, bl, false, objv_tracker, real_time()); if (ret < 0) { diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index dcec9c43aa6..1fb18aee8ab 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -129,39 +129,6 @@ int rgw_put_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& o return ret; } -int rgw_put_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive, - RGWObjVersionTracker *objv_tracker, real_time set_mtime, map *pattrs) -{ - map no_attrs; - if (!pattrs) { - pattrs = &no_attrs; - } - - rgw_raw_obj obj(pool, oid); - - auto sysobj = obj_ctx.get_obj(obj); - int ret = sysobj.wop() - .set_objv_tracker(objv_tracker) - .set_exclusive(exclusive) - .set_mtime(set_mtime) - .set_attrs(*pattrs) - .write(data, null_yield); - - if (ret == -ENOENT) { - ret = rgwstore->create_pool(pool); - if (ret >= 0) { - ret = sysobj.wop() - .set_objv_tracker(objv_tracker) - .set_exclusive(exclusive) - .set_mtime(set_mtime) - .set_attrs(*pattrs) - .write(data, null_yield); - } - } - - return ret; -} - int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl, RGWObjVersionTracker *objv_tracker, real_time *pmtime, map *pattrs, rgw_cache_entry_info *cache_info, boost::optional refresh_version) diff --git a/src/rgw/rgw_tools.h b/src/rgw/rgw_tools.h index 30c9581d1bf..927915e9ef0 100644 --- a/src/rgw/rgw_tools.h +++ b/src/rgw/rgw_tools.h @@ -24,8 +24,6 @@ int rgw_init_ioctx(librados::Rados *rados, const rgw_pool& pool, int rgw_put_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive, RGWObjVersionTracker *objv_tracker, real_time set_mtime, map *pattrs = NULL); -int rgw_put_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive, - RGWObjVersionTracker *objv_tracker, real_time set_mtime, map *pattrs = NULL); int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl, RGWObjVersionTracker *objv_tracker, real_time *pmtime, map *pattrs = NULL, rgw_cache_entry_info *cache_info = NULL, -- 2.39.5