#include "services/svc_bilog_rados.h"
#include "services/svc_mdlog.h"
#include "services/svc_meta_be_otp.h"
+#include "services/svc_user.h"
#include "services/svc_zone.h"
#define dout_context g_ceph_context
"so at most one of the two should be specified" << std::endl;
return EINVAL;
}
- ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->user->reset_stats(dpp(), user->get_id(), null_yield);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->user->reset_bucket_stats(dpp(), user->get_id(), null_yield);
if (ret < 0) {
cerr << "ERROR: could not reset user stats: " << cpp_strerror(-ret) <<
std::endl;
RGWBucketCtl::RGWBucketCtl(RGWSI_Zone *zone_svc,
RGWSI_Bucket *bucket_svc,
RGWSI_Bucket_Sync *bucket_sync_svc,
- RGWSI_BucketIndex *bi_svc) : cct(zone_svc->ctx())
+ RGWSI_BucketIndex *bi_svc,
+ RGWSI_User* user_svc)
+ : cct(zone_svc->ctx())
{
svc.zone = zone_svc;
svc.bucket = bucket_svc;
svc.bucket_sync = bucket_sync_svc;
svc.bi = bi_svc;
+ svc.user = user_svc;
}
void RGWBucketCtl::init(RGWUserCtl *user_ctl,
}
}
- ret = ctl.user->add_bucket(dpp, user_id, bucket, creation_time, y);
+ ret = svc.user->add_bucket(dpp, user_id, bucket, creation_time, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: error adding bucket to user directory:"
<< " user=" << user_id
optional_yield y,
const DoutPrefixProvider *dpp)
{
- int ret = ctl.user->remove_bucket(dpp, user_id, bucket, y);
+ int ret = svc.user->remove_bucket(dpp, user_id, bucket, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: error removing bucket from directory: "
<< cpp_strerror(-ret)<< dendl;
return r;
}
- return ctl.user->flush_bucket_stats(dpp, user_id, *pent, y);
+ return svc.user->flush_bucket_stats(dpp, user_id, *pent, y);
}
int RGWBucketCtl::get_sync_policy_handler(std::optional<rgw_zone_id> zone,
RGWSI_Bucket *bucket{nullptr};
RGWSI_Bucket_Sync *bucket_sync{nullptr};
RGWSI_BucketIndex *bi{nullptr};
+ RGWSI_User* user = nullptr;
} svc;
struct Ctl {
RGWBucketCtl(RGWSI_Zone *zone_svc,
RGWSI_Bucket *bucket_svc,
RGWSI_Bucket_Sync *bucket_sync_svc,
- RGWSI_BucketIndex *bi_svc);
+ RGWSI_BucketIndex *bi_svc,
+ RGWSI_User* user_svc);
void init(RGWUserCtl *user_ctl,
RGWBucketMetadataHandler *_bm_handler,
#include "rgw_auth.h"
class RGWObjectCtx;
-class RGWSysObjectCtx;
/** Store all the state necessary to complete and respond to an HTTP request*/
struct req_state : DoutPrefixProvider {
{
map<string, bufferlist> *pattrs = want_attrs ? &attrs : nullptr;
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = svc_sysobj->get_obj(obj);
return sysobj.rop()
.set_objv_tracker(&objv_tracker)
.set_attrs(pattrs)
RGWAsyncGetSystemObj::RGWAsyncGetSystemObj(const DoutPrefixProvider *_dpp, RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWSI_SysObj *_svc,
RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj,
bool want_attrs, bool raw_attrs)
- : RGWAsyncRadosRequest(caller, cn), dpp(_dpp), obj_ctx(_svc),
+ : RGWAsyncRadosRequest(caller, cn), dpp(_dpp), svc_sysobj(_svc),
obj(_obj), want_attrs(want_attrs), raw_attrs(raw_attrs)
{
if (_objv_tracker) {
int RGWAsyncPutSystemObj::_send_request(const DoutPrefixProvider *dpp)
{
- auto obj_ctx = svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = svc->get_obj(obj);
return sysobj.wop()
.set_objv_tracker(&objv_tracker)
.set_exclusive(exclusive)
int RGWAsyncPutSystemObjAttrs::_send_request(const DoutPrefixProvider *dpp)
{
- auto obj_ctx = svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = svc->get_obj(obj);
return sysobj.wop()
.set_objv_tracker(&objv_tracker)
.set_exclusive(exclusive)
{
int r;
if (!bucket.bucket_id.empty()) {
- RGWSysObjectCtx obj_ctx = store->svc()->sysobj->init_obj_ctx();
- r = store->getRados()->get_bucket_instance_info(obj_ctx, bucket, bucket_info, nullptr, &attrs, null_yield, dpp);
+ r = store->getRados()->get_bucket_instance_info(bucket, bucket_info, nullptr, &attrs, null_yield, dpp);
} else {
r = store->ctl()->bucket->read_bucket_info(bucket, &bucket_info, null_yield, dpp,
RGWBucketCtl::BucketInstance::GetParams().set_attrs(&attrs));
class RGWAsyncGetSystemObj : public RGWAsyncRadosRequest {
const DoutPrefixProvider *dpp;
- RGWSysObjectCtx obj_ctx;
+ RGWSI_SysObj* svc_sysobj;
rgw_raw_obj obj;
const bool want_attrs;
const bool raw_attrs;
get_oid(*pipe.source.zone, *pipe.source.bucket, *pipe.dest.bucket)};
auto svc = store->svc()->sysobj;
- auto obj_ctx = svc->init_obj_ctx();
- auto sysobj = svc->get_obj(obj_ctx, obj);
+ auto sysobj = svc->get_obj(obj);
bufferlist bl;
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0)
auto& pool = status_obj->pool;
const auto oid = status_obj->oid;
- auto obj_ctx = rados->svc()->sysobj->init_obj_ctx();
+ auto sysobj = rados->svc()->sysobj;
bufferlist bl;
- ret = rgw_get_system_obj(obj_ctx, pool, oid, bl, nullptr, nullptr,
+ ret = rgw_get_system_obj(sysobj, pool, oid, bl, nullptr, nullptr,
null_yield, dpp);
if (ret < 0) {
auto& pool = status_obj->pool;
const auto oid = status_obj->oid;
- auto obj_ctx = rados->svc()->sysobj->init_obj_ctx();
+ auto sysobj = rados->svc()->sysobj;
bufferlist bl;
status->encode(bl);
- ret = rgw_put_system_obj(dpp, obj_ctx, pool, oid, bl, true, nullptr,
+ ret = rgw_put_system_obj(dpp, sysobj, pool, oid, bl, true, nullptr,
real_time{}, null_yield);
return ret;
#include "rgw_sal_rados.h"
#include "services/svc_zone.h"
-#include "services/svc_sys_obj.h"
#define dout_subsys ceph_subsys_rgw
", entries_filter.size=" << entries_filter.size() << dendl;
RGWBucketInfo bucket_info;
- RGWSysObjectCtx sys_obj_ctx = store->svc()->sysobj->init_obj_ctx();
- int ret = store->getRados()->get_bucket_instance_info(sys_obj_ctx,
- bucket_instance_id,
+ int ret = store->getRados()->get_bucket_instance_info(bucket_instance_id,
bucket_info,
nullptr,
nullptr,
encode_json("s3_id", s3_id, f);
}
-RGWPubSub::RGWPubSub(rgw::sal::RadosStore* _store, const std::string& _tenant) :
- store(_store),
- tenant(_tenant),
- obj_ctx(store->svc()->sysobj->init_obj_ctx()) {
- get_meta_obj(&meta_obj);
+RGWPubSub::RGWPubSub(rgw::sal::RadosStore* _store, const std::string& _tenant)
+ : store(_store), tenant(_tenant), svc_sysobj(store->svc()->sysobj)
+{
+ get_meta_obj(&meta_obj);
}
int RGWPubSub::remove(const DoutPrefixProvider *dpp,
rgw::sal::RadosStore* store;
const std::string tenant;
- RGWSysObjectCtx obj_ctx;
+ RGWSI_SysObj* svc_sysobj;
rgw_raw_obj meta_obj;
int RGWPubSub::read(const rgw_raw_obj& obj, T* result, RGWObjVersionTracker* objv_tracker)
{
bufferlist bl;
- int ret = rgw_get_system_obj(obj_ctx,
+ int ret = rgw_get_system_obj(svc_sysobj,
obj.pool, obj.oid,
bl,
objv_tracker,
bufferlist bl;
encode(info, bl);
- int ret = rgw_put_system_obj(dpp, obj_ctx, obj.pool, obj.oid,
- bl, false, objv_tracker,
- real_time(), y);
- if (ret < 0) {
- return ret;
- }
-
- obj_ctx.invalidate(obj);
- return 0;
+ return rgw_put_system_obj(dpp, svc_sysobj, obj.pool, obj.oid,
+ bl, false, objv_tracker, real_time(), y);
}
#endif
rgw_bucket bucket = bucket_info.bucket;
bucket.update_bucket_id(new_bucket_id);
- auto obj_ctx = store->svc.sysobj->init_obj_ctx();
-
bucket_info.objv_tracker.clear();
- int ret = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, nullptr, nullptr, null_yield, dpp);
+ int ret = store->get_bucket_instance_info(bucket, bucket_info, nullptr, nullptr, null_yield, dpp);
if (ret < 0) {
return ret;
}
{
bucket = _bucket;
- auto obj_ctx = store->svc.sysobj->init_obj_ctx();
-
RGWBucketInfo bucket_info;
RGWBucketInfo* bucket_info_p =
bucket_info_out ? bucket_info_out : &bucket_info;
- int ret = store->get_bucket_instance_info(obj_ctx, bucket, *bucket_info_p, NULL, NULL, null_yield, dpp);
+ int ret = store->get_bucket_instance_info(bucket, *bucket_info_p, NULL, NULL, null_yield, dpp);
if (ret < 0) {
return ret;
}
RGWBucketInfo info;
map<string, bufferlist> attrs;
int r;
- auto obj_ctx = svc.sysobj->init_obj_ctx();
if (bucket.bucket_id.empty()) {
r = get_bucket_info(&svc, bucket.tenant, bucket.name, info, NULL, null_yield, dpp, &attrs);
} else {
- r = get_bucket_instance_info(obj_ctx, bucket, info, nullptr, &attrs, null_yield, dpp);
+ r = get_bucket_instance_info(bucket, info, nullptr, &attrs, null_yield, dpp);
}
if (r < 0) {
ldpp_dout(dpp, 0) << "NOTICE: get_bucket_info on bucket=" << bucket.name << " returned err=" << r << dendl;
std::string oid, key;
get_obj_bucket_and_oid_loc(obj, oid, key);
- auto obj_ctx = svc.sysobj->init_obj_ctx();
-
RGWBucketInfo bucket_info;
- int ret = get_bucket_instance_info(obj_ctx, obj.bucket, bucket_info, NULL, NULL, null_yield, dpp);
+ int ret = get_bucket_instance_info(obj.bucket, bucket_info, NULL, NULL, null_yield, dpp);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ << "() get_bucket_instance_info(bucket=" << obj.bucket << ") returned ret=" << ret << dendl;
return ret;
return r;
}
-int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx,
- const string& meta_key,
+int RGWRados::get_bucket_instance_info(const string& meta_key,
RGWBucketInfo& info,
real_time *pmtime,
map<string, bufferlist> *pattrs,
rgw_bucket bucket;
rgw_bucket_parse_bucket_key(cct, meta_key, &bucket, nullptr);
- return get_bucket_instance_info(obj_ctx, bucket, info, pmtime, pattrs, y, dpp);
+ return get_bucket_instance_info(bucket, info, pmtime, pattrs, y, dpp);
}
-int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info,
+int RGWRados::get_bucket_instance_info(const rgw_bucket& bucket, RGWBucketInfo& info,
real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y,
const DoutPrefixProvider *dpp)
{
- RGWSI_MetaBackend_CtxParams bectx_params = RGWSI_MetaBackend_CtxParams_SObj(&obj_ctx);
return ctl.bucket->read_bucket_instance_info(bucket, &info,
y,
dpp,
RGWBucketCtl::BucketInstance::GetParams()
.set_mtime(pmtime)
- .set_attrs(pattrs)
- .set_bectx_params(bectx_params));
+ .set_attrs(pattrs));
}
int RGWRados::get_bucket_info(RGWServices *svc,
optional_yield y,
const DoutPrefixProvider *dpp, map<string, bufferlist> *pattrs)
{
- auto obj_ctx = svc->sysobj->init_obj_ctx();
- RGWSI_MetaBackend_CtxParams bectx_params = RGWSI_MetaBackend_CtxParams_SObj(&obj_ctx);
rgw_bucket bucket;
bucket.tenant = tenant;
bucket.name = bucket_name;
return ctl.bucket->read_bucket_info(bucket, &info, y, dpp,
RGWBucketCtl::BucketInstance::GetParams()
.set_mtime(pmtime)
- .set_attrs(pattrs)
- .set_bectx_params(bectx_params));
+ .set_attrs(pattrs));
}
int RGWRados::try_refresh_bucket_info(RGWBucketInfo& info,
int RGWRados::update_containers_stats(map<string, RGWBucketEnt>& m, const DoutPrefixProvider *dpp)
{
- auto obj_ctx = svc.sysobj->init_obj_ctx();
-
map<string, RGWBucketEnt>::iterator iter;
for (iter = m.begin(); iter != m.end(); ++iter) {
RGWBucketEnt& ent = iter->second;
vector<rgw_bucket_dir_header> headers;
RGWBucketInfo bucket_info;
- int ret = get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL, null_yield, dpp);
+ int ret = get_bucket_instance_info(bucket, bucket_info, NULL, NULL, null_yield, dpp);
if (ret < 0) {
return ret;
}
class RGWReshard;
class RGWReshardWait;
-class RGWSysObjectCtx;
struct get_obj_data;
/* flags for put_obj_meta() */
int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, std::map<std::string, bufferlist> *pattrs, const DoutPrefixProvider *dpp);
/* xxx dang obj_ctx -> svc */
- int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const std::string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, std::map<std::string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
- int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, std::map<std::string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
+ int get_bucket_instance_info(const std::string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, std::map<std::string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
+ int get_bucket_instance_info(const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, std::map<std::string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
static void make_bucket_entry_name(const std::string& tenant_name, const std::string& bucket_name, std::string& bucket_entry);
const DoutPrefixProvider* dpp)
{
RGWBucketInfo info;
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
- int r = store->getRados()->get_bucket_instance_info(obj_ctx, bucket, info,
- nullptr, nullptr, null_yield, dpp);
+ int r = store->getRados()->get_bucket_instance_info(bucket, info, nullptr,
+ nullptr, null_yield, dpp);
if (r < 0) {
return r;
}
if (ret == -ECANCELED) {
// racing write detected, read the latest bucket info and try again
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
int ret2 = store->getRados()->get_bucket_instance_info(
- obj_ctx, bucket_info.bucket, bucket_info,
+ bucket_info.bucket, bucket_info,
nullptr, &bucket_attrs, null_yield, dpp);
if (ret2 < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ << " failed to read "
if (ret == -ECANCELED) {
// racing write detected, read the latest bucket info and try again
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
int ret2 = store->getRados()->get_bucket_instance_info(
- obj_ctx, bucket_info.bucket, bucket_info,
+ bucket_info.bucket, bucket_info,
nullptr, &bucket_attrs, null_yield, dpp);
if (ret2 < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ << " failed to read "
ret = commit_target_layout(store, bucket_info, bucket_attrs, fault, dpp);
if (ret == -ECANCELED) {
// racing write detected, read the latest bucket info and try again
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
int ret2 = store->getRados()->get_bucket_instance_info(
- obj_ctx, bucket_info.bucket, bucket_info,
+ bucket_info.bucket, bucket_info,
nullptr, &bucket_attrs, null_yield, dpp);
if (ret2 < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ << " failed to read "
#include "services/svc_config_key.h"
#include "services/svc_zone_utils.h"
#include "services/svc_role_rados.h"
+#include "services/svc_user.h"
#include "cls/rgw/cls_rgw_client.h"
#include "rgw_pubsub.h"
int RadosUser::read_stats_async(const DoutPrefixProvider *dpp, RGWGetUserStats_CB* cb)
{
- return store->ctl()->user->read_stats_async(dpp, get_id(), cb);
+ return store->svc()->user->read_stats_async(dpp, get_id(), cb);
}
int RadosUser::complete_flush_stats(const DoutPrefixProvider *dpp, optional_yield y)
{
- return store->ctl()->user->complete_flush_stats(dpp, get_id(), y);
+ return store->svc()->user->complete_flush_stats(dpp, get_id(), y);
}
int RadosUser::read_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch,
int RadosBucket::load_bucket(const DoutPrefixProvider* dpp, optional_yield y, bool get_stats)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
int ret;
- RGWSI_MetaBackend_CtxParams bectx_params = RGWSI_MetaBackend_CtxParams_SObj(&obj_ctx);
+ RGWSI_MetaBackend_CtxParams bectx_params = RGWSI_MetaBackend_CtxParams_SObj();
RGWObjVersionTracker ep_ot;
if (info.bucket.bucket_id.empty()) {
ret = store->ctl()->bucket->read_bucket_info(info.bucket, &info, y, dpp,
{
std::string prefix = tenant + RGWOIDCProvider::oidc_url_oid_prefix;
auto pool = svc()->zone->get_zone_params().oidc_pool;
- auto obj_ctx = svc()->sysobj->init_obj_ctx();
//Get the filtered objects
list<std::string> result;
std::unique_ptr<rgw::sal::RGWOIDCProvider> provider = get_oidc_provider();
bufferlist bl;
- r = rgw_get_system_obj(obj_ctx, pool, iter, bl, nullptr, nullptr, null_yield, dpp);
+ r = rgw_get_system_obj(svc()->sysobj, pool, iter, bl, nullptr, nullptr, null_yield, dpp);
if (r < 0) {
return r;
}
std::map<std::string, bufferlist> *m,
bool* pmore, optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
rgw_raw_obj raw_obj;
get_raw_obj(&raw_obj);
- auto sysobj = obj_ctx.get_obj(raw_obj);
+ auto sysobj = store->svc()->sysobj->get_obj(raw_obj);
return sysobj.omap().get_vals(dpp, marker, count, m, pmore, y);
}
int RadosObject::omap_get_all(const DoutPrefixProvider *dpp, std::map<std::string, bufferlist> *m,
optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
rgw_raw_obj raw_obj;
get_raw_obj(&raw_obj);
- auto sysobj = obj_ctx.get_obj(raw_obj);
+ auto sysobj = store->svc()->sysobj->get_obj(raw_obj);
return sysobj.omap().get_all(dpp, m, y);
}
store->getRados()->obj_to_raw(bucket->get_placement_rule(), obj, &raw_meta_obj);
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(raw_meta_obj);
+ auto sysobj = store->svc()->sysobj->get_obj(raw_meta_obj);
return sysobj.omap().set_must_exist(must_exist).set(dpp, key, val, y);
}
int RadosLuaScriptManager::get(const DoutPrefixProvider* dpp, optional_yield y, const std::string& key, std::string& script)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
bufferlist bl;
- int r = rgw_get_system_obj(obj_ctx, pool, key, bl, nullptr, nullptr, y, dpp);
+ int r = rgw_get_system_obj(store->svc()->sysobj, pool, key, bl, nullptr, nullptr, y, dpp);
if (r < 0) {
return r;
}
int RadosLuaScriptManager::put(const DoutPrefixProvider* dpp, optional_yield y, const std::string& key, const std::string& script)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
bufferlist bl;
ceph::encode(script, bl);
- int r = rgw_put_system_obj(dpp, obj_ctx, pool, key, bl, false, nullptr, real_time(), y);
+ int r = rgw_put_system_obj(dpp, store->svc()->sysobj, pool, key, bl, false, nullptr, real_time(), y);
if (r < 0) {
return r;
}
int RadosOIDCProvider::store_url(const DoutPrefixProvider *dpp, const std::string& url, bool exclusive, optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
+ auto sysobj = store->svc()->sysobj;
std::string oid = tenant + get_url_oid_prefix() + url;
bufferlist bl;
using ceph::encode;
encode(*this, bl);
- return rgw_put_system_obj(dpp, obj_ctx, store->svc()->zone->get_zone_params().oidc_pool, oid, bl, exclusive, nullptr, real_time(), y);
+ return rgw_put_system_obj(dpp, sysobj, store->svc()->zone->get_zone_params().oidc_pool, oid, bl, exclusive, nullptr, real_time(), y);
}
int RadosOIDCProvider::read_url(const DoutPrefixProvider *dpp, const std::string& url, const std::string& tenant)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
+ auto sysobj = store->svc()->sysobj;
auto& pool = store->svc()->zone->get_zone_params().oidc_pool;
std::string oid = tenant + get_url_oid_prefix() + url;
bufferlist bl;
- int ret = rgw_get_system_obj(obj_ctx, pool, oid, bl, nullptr, nullptr, null_yield, dpp);
+ int ret = rgw_get_system_obj(sysobj, pool, oid, bl, nullptr, nullptr, null_yield, dpp);
if (ret < 0) {
return ret;
}
int RadosRole::store_name(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
+ auto sysobj = store->svc()->sysobj;
RGWNameToId nameToId;
nameToId.obj_id = info.id;
using ceph::encode;
encode(nameToId, bl);
- return rgw_put_system_obj(dpp, obj_ctx, store->svc()->zone->get_zone_params().roles_pool, oid, bl, exclusive, &info.objv_tracker, real_time(), y);
+ return rgw_put_system_obj(dpp, sysobj, store->svc()->zone->get_zone_params().roles_pool, oid, bl, exclusive, &info.objv_tracker, real_time(), y);
}
int RadosRole::store_path(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
+ auto sysobj = store->svc()->sysobj;
std::string oid = info.tenant + get_path_oid_prefix() + info.path + get_info_oid_prefix() + info.id;
bufferlist bl;
- return rgw_put_system_obj(dpp, obj_ctx, store->svc()->zone->get_zone_params().roles_pool, oid, bl, exclusive, &info.objv_tracker, real_time(), y);
+ return rgw_put_system_obj(dpp, sysobj, store->svc()->zone->get_zone_params().roles_pool, oid, bl, exclusive, &info.objv_tracker, real_time(), y);
}
int RadosRole::read_id(const DoutPrefixProvider *dpp, const std::string& role_name, const std::string& tenant, std::string& role_id, optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
+ auto sysobj = store->svc()->sysobj;
std::string oid = info.tenant + get_names_oid_prefix() + role_name;
bufferlist bl;
- int ret = rgw_get_system_obj(obj_ctx, store->svc()->zone->get_zone_params().roles_pool, oid, bl, nullptr, nullptr, null_yield, dpp);
+ int ret = rgw_get_system_obj(sysobj, store->svc()->zone->get_zone_params().roles_pool, oid, bl, nullptr, nullptr, null_yield, dpp);
if (ret < 0) {
return ret;
}
int RadosRole::read_name(const DoutPrefixProvider *dpp, optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
+ auto sysobj = store->svc()->sysobj;
std::string oid = info.tenant + get_names_oid_prefix() + info.name;
bufferlist bl;
- int ret = rgw_get_system_obj(obj_ctx, store->svc()->zone->get_zone_params().roles_pool, oid, bl, nullptr, nullptr, null_yield, dpp);
+ int ret = rgw_get_system_obj(sysobj, store->svc()->zone->get_zone_params().roles_pool, oid, bl, nullptr, nullptr, null_yield, dpp);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: failed reading role name from Role pool: " << info.name <<
": " << cpp_strerror(-ret) << dendl;
int RadosRole::read_info(const DoutPrefixProvider *dpp, optional_yield y)
{
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
std::string oid;
oid = info.id;
bucket.reset(new RGWBucketCtl(svc.zone,
svc.bucket,
svc.bucket_sync,
- svc.bi));
+ svc.bi, svc.user));
otp.reset(new RGWOTPCtl(svc.zone, svc.otp));
RGWBucketMetadataHandlerBase *bucket_meta_handler = static_cast<RGWBucketMetadataHandlerBase *>(meta.bucket.get());
// fetch source bucket info
spawn::spawn(ioctx, [&] (yield_context yield) {
auto y = optional_yield{ioctx, yield};
- auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
int r = store->getRados()->get_bucket_instance_info(
- obj_ctx, *entry.pipe.source.bucket, entry.source_bucket_info,
+ *entry.pipe.source.bucket, entry.source_bucket_info,
nullptr, nullptr, y, dpp);
if (r < 0) {
ldpp_dout(dpp, 0) << "failed to read source bucket info: "
return &no_change;
}
-int rgw_put_system_obj(const DoutPrefixProvider *dpp,
- RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive,
+int rgw_put_system_obj(const DoutPrefixProvider *dpp, RGWSI_SysObj* svc_sysobj,
+ const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive,
RGWObjVersionTracker *objv_tracker, real_time set_mtime, optional_yield y, map<string, bufferlist> *pattrs)
{
map<string,bufferlist> no_attrs;
rgw_raw_obj obj(pool, oid);
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = svc_sysobj->get_obj(obj);
int ret;
if (pattrs != no_change_attrs()) {
return ret;
}
-int rgw_stat_system_obj(const DoutPrefixProvider *dpp,
- RGWSysObjectCtx& obj_ctx, const rgw_pool& pool,
- const std::string& key, RGWObjVersionTracker *objv_tracker,
+int rgw_stat_system_obj(const DoutPrefixProvider *dpp, RGWSI_SysObj* svc_sysobj,
+ const rgw_pool& pool, const std::string& key,
+ RGWObjVersionTracker *objv_tracker,
real_time *pmtime, optional_yield y,
std::map<std::string, bufferlist> *pattrs)
{
rgw_raw_obj obj(pool, key);
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = svc_sysobj->get_obj(obj);
return sysobj.rop()
.set_attrs(pattrs)
.set_last_mod(pmtime)
}
-int rgw_get_system_obj(RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl,
+int rgw_get_system_obj(RGWSI_SysObj* svc_sysobj, const rgw_pool& pool, const string& key, bufferlist& bl,
RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, const DoutPrefixProvider *dpp, map<string, bufferlist> *pattrs,
rgw_cache_entry_info *cache_info,
boost::optional<obj_version> refresh_version, bool raw_attrs)
}
do {
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = svc_sysobj->get_obj(obj);
auto rop = sysobj.rop();
int ret = rop.set_attrs(pattrs)
if (objv_tracker) {
objv_tracker->read_version.clear();
}
- sysobj.invalidate();
continue;
}
if (ret < 0)
RGWSI_SysObj *sysobj_svc, const rgw_pool& pool, const string& oid,
RGWObjVersionTracker *objv_tracker, optional_yield y)
{
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(rgw_raw_obj{pool, oid});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, oid});
rgw_raw_obj obj(pool, oid);
return sysobj.wop()
.set_objv_tracker(objv_tracker)
class RGWSI_SysObj;
class RGWRados;
-class RGWSysObjectCtx;
struct RGWObjVersionTracker;
class optional_yield;
void rgw_shard_name(const std::string& prefix, unsigned max_shards, const std::string& section, const std::string& key, std::string& name);
void rgw_shard_name(const std::string& prefix, unsigned shard_id, std::string& name);
-int rgw_put_system_obj(const DoutPrefixProvider *dpp, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const std::string& oid, bufferlist& data, bool exclusive,
- RGWObjVersionTracker *objv_tracker, real_time set_mtime, optional_yield y, std::map<std::string, bufferlist> *pattrs = NULL);
-int rgw_get_system_obj(RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const std::string& key, bufferlist& bl,
- RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, const DoutPrefixProvider *dpp, std::map<std::string, bufferlist> *pattrs = NULL,
- rgw_cache_entry_info *cache_info = NULL,
- boost::optional<obj_version> refresh_version = boost::none, bool raw_attrs=false);
+int rgw_put_system_obj(const DoutPrefixProvider *dpp, RGWSI_SysObj* svc_sysobj,
+ const rgw_pool& pool, const std::string& oid,
+ bufferlist& data, bool exclusive,
+ RGWObjVersionTracker *objv_tracker,
+ real_time set_mtime, optional_yield y,
+ std::map<std::string, bufferlist> *pattrs = nullptr);
+int rgw_get_system_obj(RGWSI_SysObj* svc_sysobj, const rgw_pool& pool,
+ const std::string& key, bufferlist& bl,
+ RGWObjVersionTracker *objv_tracker, real_time *pmtime,
+ optional_yield y, const DoutPrefixProvider *dpp,
+ std::map<std::string, bufferlist> *pattrs = nullptr,
+ rgw_cache_entry_info *cache_info = nullptr,
+ boost::optional<obj_version> refresh_version = boost::none,
+ bool raw_attrs=false);
int rgw_delete_system_obj(const DoutPrefixProvider *dpp,
RGWSI_SysObj *sysobj_svc, const rgw_pool& pool, const std::string& oid,
RGWObjVersionTracker *objv_tracker, optional_yield y);
-int rgw_stat_system_obj(const DoutPrefixProvider *dpp,
- RGWSysObjectCtx& obj_Ctx, const rgw_pool& pool,
- const std::string& key, RGWObjVersionTracker *objv_tracker,
+int rgw_stat_system_obj(const DoutPrefixProvider *dpp, RGWSI_SysObj* svc_sysobj,
+ const rgw_pool& pool, const std::string& key,
+ RGWObjVersionTracker *objv_tracker,
real_time *pmtime, optional_yield y,
std::map<std::string, bufferlist> *pattrs = nullptr);
});
}
-int RGWUserCtl::add_bucket(const DoutPrefixProvider *dpp,
- const rgw_user& user,
- const rgw_bucket& bucket,
- ceph::real_time creation_time,
- optional_yield y)
-
-{
- return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
- return svc.user->add_bucket(dpp, op->ctx(), user, bucket, creation_time, y);
- });
-}
-
-int RGWUserCtl::remove_bucket(const DoutPrefixProvider *dpp,
- const rgw_user& user,
- const rgw_bucket& bucket,
- optional_yield y)
-
-{
- return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
- return svc.user->remove_bucket(dpp, op->ctx(), user, bucket, y);
- });
-}
-
int RGWUserCtl::list_buckets(const DoutPrefixProvider *dpp,
const rgw_user& user,
const string& marker,
max = default_max;
}
- return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
- int ret = svc.user->list_buckets(dpp, op->ctx(), user, marker, end_marker,
- max, buckets, is_truncated, y);
- if (ret < 0) {
+ int ret = svc.user->list_buckets(dpp, user, marker, end_marker,
+ max, buckets, is_truncated, y);
+ if (ret < 0) {
+ return ret;
+ }
+ if (need_stats) {
+ map<string, RGWBucketEnt>& m = buckets->get_buckets();
+ ret = ctl.bucket->read_buckets_stats(m, y, dpp);
+ if (ret < 0 && ret != -ENOENT) {
+ ldpp_dout(dpp, 0) << "ERROR: could not get stats for buckets" << dendl;
return ret;
}
- if (need_stats) {
- map<string, RGWBucketEnt>& m = buckets->get_buckets();
- ret = ctl.bucket->read_buckets_stats(m, y, dpp);
- if (ret < 0 && ret != -ENOENT) {
- ldpp_dout(dpp, 0) << "ERROR: could not get stats for buckets" << dendl;
- return ret;
- }
- }
- return 0;
- });
-}
-
-int RGWUserCtl::flush_bucket_stats(const DoutPrefixProvider *dpp,
- const rgw_user& user,
- const RGWBucketEnt& ent,
- optional_yield y)
-{
- return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
- return svc.user->flush_bucket_stats(dpp, op->ctx(), user, ent, y);
- });
-}
-
-int RGWUserCtl::complete_flush_stats(const DoutPrefixProvider *dpp, const rgw_user& user, optional_yield y)
-{
- return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
- return svc.user->complete_flush_stats(dpp, op->ctx(), user, y);
- });
-}
-
-int RGWUserCtl::reset_stats(const DoutPrefixProvider *dpp, const rgw_user& user, optional_yield y)
-{
- return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
- return svc.user->reset_bucket_stats(dpp, op->ctx(), user, y);
- });
+ }
+ return 0;
}
int RGWUserCtl::read_stats(const DoutPrefixProvider *dpp,
});
}
-int RGWUserCtl::read_stats_async(const DoutPrefixProvider *dpp, const rgw_user& user, RGWGetUserStats_CB *cb)
-{
- return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
- return svc.user->read_stats_async(dpp, op->ctx(), user, cb);
- });
-}
-
RGWMetadataHandler *RGWUserMetaHandlerAllocator::alloc(RGWSI_User *user_svc) {
return new RGWUserMetadataHandler(user_svc);
}
const RGWUserInfo& info, optional_yield y,
const RemoveParams& params = {});
- int add_bucket(const DoutPrefixProvider *dpp,
- const rgw_user& user,
- const rgw_bucket& bucket,
- ceph::real_time creation_time,
- optional_yield y);
- int remove_bucket(const DoutPrefixProvider *dpp,
- const rgw_user& user,
- const rgw_bucket& bucket, optional_yield y);
int list_buckets(const DoutPrefixProvider *dpp,
const rgw_user& user,
const std::string& marker,
optional_yield y,
uint64_t default_max = 1000);
- int flush_bucket_stats(const DoutPrefixProvider *dpp,
- const rgw_user& user,
- const RGWBucketEnt& ent,
- optional_yield y);
- int complete_flush_stats(const DoutPrefixProvider *dpp, const rgw_user& user, optional_yield y);
- int reset_stats(const DoutPrefixProvider *dpp, const rgw_user& user, optional_yield y);
int read_stats(const DoutPrefixProvider *dpp,
const rgw_user& user, RGWStorageStats *stats,
optional_yield y,
ceph::real_time *last_stats_sync = nullptr, /* last time a full stats sync completed */
ceph::real_time *last_stats_update = nullptr); /* last time a stats update was done */
- int read_stats_async(const DoutPrefixProvider *dpp, const rgw_user& user, RGWGetUserStats_CB *ctx);
};
class RGWUserMetaHandlerAllocator {
auto pool = get_pool(cct);
bufferlist bl;
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0)
return ret;
encode(default_info, bl);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
int ret = sysobj.wop()
.set_exclusive(exclusive)
.write(dpp, bl, y);
string oid = get_names_oid_prefix() + obj_name;
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0) {
return ret;
{
rgw_pool pool(get_pool(cct));
- auto obj_ctx = sysobj_svc->init_obj_ctx();
-
/* check to see if obj is the default */
RGWDefaultSystemMetaObjInfo default_info;
int ret = read_default(dpp, default_info, get_default_oid(old_format), y);
if (default_info.default_id == id || (old_format && default_info.default_id == name)) {
string oid = get_default_oid(old_format);
rgw_raw_obj default_named_obj(pool, oid);
- auto sysobj = sysobj_svc->get_obj(obj_ctx, default_named_obj);
+ auto sysobj = sysobj_svc->get_obj(default_named_obj);
ret = sysobj.wop().remove(dpp, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "Error delete default obj name " << name << ": " << cpp_strerror(-ret) << dendl;
if (!old_format) {
string oid = get_names_oid_prefix() + name;
rgw_raw_obj object_name(pool, oid);
- auto sysobj = sysobj_svc->get_obj(obj_ctx, object_name);
+ auto sysobj = sysobj_svc->get_obj(object_name);
ret = sysobj.wop().remove(dpp, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "Error delete obj name " << name << ": " << cpp_strerror(-ret) << dendl;
}
rgw_raw_obj object_id(pool, oid);
- auto sysobj = sysobj_svc->get_obj(obj_ctx, object_id);
+ auto sysobj = sysobj_svc->get_obj(object_id);
ret = sysobj.wop().remove(dpp, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "Error delete object id " << id << ": " << cpp_strerror(-ret) << dendl;
bufferlist bl;
using ceph::encode;
encode(nameToId, bl);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
return sysobj.wop()
.set_exclusive(exclusive)
.write(dpp, bl, y);
rgw_pool pool(get_pool(cct));
string oid = get_names_oid_prefix() + old_name;
rgw_raw_obj old_name_obj(pool, oid);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, old_name_obj);
+ auto sysobj = sysobj_svc->get_obj(old_name_obj);
ret = sysobj.wop().remove(dpp, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "Error delete old obj name " << old_name << ": " << cpp_strerror(-ret) << dendl;
string oid = get_info_oid_prefix(old_format) + obj_id;
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, oid});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, oid});
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "failed reading obj info from " << pool << ":" << oid << ": " << cpp_strerror(-ret) << dendl;
bufferlist bl;
using ceph::encode;
encode(*this, bl);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, oid});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, oid});
return sysobj.wop()
.set_exclusive(exclusive)
.write(dpp, bl, y);
auto pool = rgw_pool{get_pool(cct)};
auto oid = get_control_oid();
bufferlist bl;
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, oid});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, oid});
return sysobj.wop()
.set_exclusive(exclusive)
.write(dpp, bl, y);
{
auto pool = rgw_pool{get_pool(cct)};
auto obj = rgw_raw_obj{pool, get_control_oid()};
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, obj);
+ auto sysobj = sysobj_svc->get_obj(obj);
return sysobj.wop().remove(dpp, y);
}
int RGWRealm::notify_zone(const DoutPrefixProvider *dpp, bufferlist& bl, optional_yield y)
{
rgw_pool pool{get_pool(cct)};
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, get_control_oid()});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, get_control_oid()});
int ret = sysobj.wn().notify(dpp, bl, 0, nullptr, y);
if (ret < 0) {
return ret;
const auto& oid = get_oid(realm_id);
bufferlist bl;
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, oid});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, oid});
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0) {
return ret;
bufferlist bl;
using ceph::encode;
encode(*this, bl);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, oid});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, oid});
return sysobj.wop()
.set_exclusive(false)
.write(dpp, bl, y);
rgw_pool pool(get_pool(cct));
bufferlist bl;
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, oid});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, oid});
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0) {
ldpp_dout(dpp, 1) << "error read_lastest_epoch " << pool << ":" << oid << dendl;
using ceph::encode;
encode(info, bl);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
return sysobj.wop()
.set_exclusive(exclusive)
.write(dpp, bl, y);
for (epoch_t e = 1; e <= epoch; e++) {
RGWPeriod p{get_id(), e};
rgw_raw_obj oid{pool, p.get_period_oid()};
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, oid);
+ auto sysobj = sysobj_svc->get_obj(oid);
int ret = sysobj.wop().remove(dpp, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "WARNING: failed to delete period object " << oid
// delete the .latest_epoch object
rgw_raw_obj oid{pool, get_period_oid_prefix() + get_latest_epoch_oid()};
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, oid);
+ auto sysobj = sysobj_svc->get_obj(oid);
int ret = sysobj.wop().remove(dpp, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "WARNING: failed to delete period object " << oid
bufferlist bl;
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj{pool, get_period_oid()});
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj{pool, get_period_oid()});
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "failed reading obj info from " << pool << ":" << get_period_oid() << ": " << cpp_strerror(-ret) << dendl;
using ceph::encode;
encode(*this, bl);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ auto sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
return sysobj.wop()
.set_exclusive(exclusive)
.write(dpp, bl, y);
{
/* check for old pools config */
rgw_raw_obj obj(domain_root, avail_pools);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = sysobj_svc->get_obj(obj_ctx, obj);
+ auto sysobj = sysobj_svc->get_obj(obj);
int r = sysobj.rop().stat(y, dpp);
if (r < 0) {
ldpp_dout(dpp, 10) << "couldn't find old data placement pools config, setting up new ones for the zone" << dendl;
RGWSI_SysObj *sysobj;
} svc;
- RGWSysObjectCtx obj_ctx;
rgw_raw_obj obj;
RGWSysObj sysobj;
RGWSI_BS_SObj_HintIndexObj(RGWSI_SysObj *_sysobj_svc,
const rgw_raw_obj& _obj) : cct(_sysobj_svc->ctx()),
- obj_ctx(_sysobj_svc->init_obj_ctx()),
obj(_obj),
- sysobj(obj_ctx.get_obj(obj))
+ sysobj(_sysobj_svc->get_obj(obj))
{
svc.sysobj = _sysobj_svc;
}
optional_yield y,
const DoutPrefixProvider *dpp) const
{
- auto obj_ctx = svc.sysobj->init_obj_ctx();
auto& pool = svc.zone->get_zone_params().log_pool;
const auto& oid = RGWMetadataLogHistory::oid;
bufferlist bl;
- int ret = rgw_get_system_obj(obj_ctx, pool, oid, bl, objv_tracker, nullptr, y, dpp);
+ int ret = rgw_get_system_obj(svc.sysobj, pool, oid, bl, objv_tracker, nullptr, y, dpp);
if (ret < 0) {
return ret;
}
if (bl.length() == 0) {
/* bad history object, remove it */
rgw_raw_obj obj(pool, oid);
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = svc.sysobj->get_obj(obj);
ret = sysobj.wop().remove(dpp, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: meta history is empty, but cannot remove it (" << cpp_strerror(-ret) << ")" << dendl;
auto& pool = svc.zone->get_zone_params().log_pool;
const auto& oid = RGWMetadataLogHistory::oid;
- auto obj_ctx = svc.sysobj->init_obj_ctx();
- return rgw_put_system_obj(dpp, obj_ctx, pool, oid, bl,
+ return rgw_put_system_obj(dpp, svc.sysobj, pool, oid, bl,
exclusive, objv_tracker, real_time{}, y);
}
RGWSI_MetaBackend::Context *RGWSI_MetaBackend_OTP::alloc_ctx()
{
- return new Context_OTP(sysobj_svc);
+ return new Context_OTP;
}
int RGWSI_MetaBackend_OTP::call_with_get_params(ceph::real_time *pmtime, std::function<int(RGWSI_MetaBackend::GetParams&)> cb)
public:
struct Context_OTP : public RGWSI_MetaBackend_SObj::Context_SObj {
otp_devices_list_t devices;
-
- Context_OTP(RGWSI_SysObj*_sysobj_svc) : RGWSI_MetaBackend_SObj::Context_SObj(_sysobj_svc, nullptr) {}
};
RGWSI_MetaBackend_OTP(CephContext *cct);
#include <variant>
-struct RGWSysObjectCtx;
-
-struct RGWSI_MetaBackend_CtxParams_SObj {
- RGWSysObjectCtx *sysobj_ctx{nullptr};
-
- RGWSI_MetaBackend_CtxParams_SObj() {}
- RGWSI_MetaBackend_CtxParams_SObj(RGWSysObjectCtx * _sysobj_ctx) : sysobj_ctx(_sysobj_ctx) {}
-};
+struct RGWSI_MetaBackend_CtxParams_SObj {};
using RGWSI_MetaBackend_CtxParams = std::variant<RGWSI_MetaBackend_CtxParams_SObj>;
RGWSI_MetaBackend::Context *RGWSI_MetaBackend_SObj::alloc_ctx()
{
- return new Context_SObj(sysobj_svc);
+ return new Context_SObj;
}
int RGWSI_MetaBackend_SObj::pre_modify(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *_ctx,
int RGWSI_MetaBackend_SObj::call(std::optional<RGWSI_MetaBackend_CtxParams> opt,
std::function<int(RGWSI_MetaBackend::Context *)> f)
{
- if (!opt) {
- RGWSI_MetaBackend_SObj::Context_SObj ctx(sysobj_svc);
- return f(&ctx);
- }
-
- try {
- auto& opt_sobj = std::get<RGWSI_MetaBackend_CtxParams_SObj>(*opt); // w contains int, not float: will throw
-
- RGWSI_MetaBackend_SObj::Context_SObj ctx(sysobj_svc, opt_sobj.sysobj_ctx);
- return f(&ctx);
- } catch (const std::bad_variant_access&) {
- ldout(cct, 0) << "ERROR: possible bug: " << __FILE__ << ":" << __LINE__ << ":" << __func__ << "(): bad variant access" << dendl;
- }
-
- return -EINVAL;
+ RGWSI_MetaBackend_SObj::Context_SObj ctx;
+ return f(&ctx);
}
void RGWSI_MetaBackend_SObj::Context_SObj::init(RGWSI_MetaBackend_Handler *h)
{
RGWSI_MetaBackend_Handler_SObj *handler = static_cast<RGWSI_MetaBackend_Handler_SObj *>(h);
module = handler->module;
- if (!obj_ctx) {
- _obj_ctx.emplace(sysobj_svc->init_obj_ctx());
- obj_ctx = &(*_obj_ctx);
- }
}
int RGWSI_MetaBackend_SObj::call_with_get_params(ceph::real_time *pmtime, std::function<int(RGWSI_MetaBackend::GetParams&)> cb)
ctx->module->get_pool_and_oid(key, &pool, &oid);
int ret = 0;
- ret = rgw_get_system_obj(*ctx->obj_ctx, pool, oid, *params.pbl,
+ ret = rgw_get_system_obj(sysobj_svc, pool, oid, *params.pbl,
objv_tracker, params.pmtime,
y, dpp,
params.pattrs, params.cache_info,
string oid;
ctx->module->get_pool_and_oid(key, &pool, &oid);
- return rgw_put_system_obj(dpp, *ctx->obj_ctx, pool, oid, params.bl, params.exclusive,
+ return rgw_put_system_obj(dpp, sysobj_svc, pool, oid, params.bl, params.exclusive,
objv_tracker, params.mtime, y, params.pattrs);
}
ctx->module->get_pool_and_oid(key, &pool, &oid);
rgw_raw_obj k(pool, oid);
- auto sysobj = ctx->obj_ctx->get_obj(k);
+ auto sysobj = sysobj_svc->get_obj(k);
return sysobj.wop()
.set_objv_tracker(objv_tracker)
.remove(dpp, y);
public:
struct Context_SObj : public RGWSI_MetaBackend::Context {
- RGWSI_SysObj *sysobj_svc{nullptr};
-
RGWSI_MBSObj_Handler_Module *module{nullptr};
- std::optional<RGWSysObjectCtx> _obj_ctx;
- RGWSysObjectCtx *obj_ctx{nullptr};
struct _list {
std::optional<RGWSI_SysObj::Pool> pool;
std::optional<RGWSI_SysObj::Pool::Op> op;
} list;
- Context_SObj(RGWSI_SysObj *_sysobj_svc,
- RGWSysObjectCtx *_oc = nullptr) : sysobj_svc(_sysobj_svc),
- obj_ctx(_oc) {}
-
void init(RGWSI_MetaBackend_Handler *h) override;
};
using namespace std;
-RGWSysObjectCtx RGWSI_SysObj::init_obj_ctx()
+RGWSI_SysObj::Obj RGWSI_SysObj::get_obj(const rgw_raw_obj& obj)
{
- return RGWSysObjectCtx(this);
-}
-
-RGWSI_SysObj::Obj RGWSI_SysObj::get_obj(RGWSysObjectCtx& obj_ctx, const rgw_raw_obj& obj)
-{
- return Obj(core_svc, obj_ctx, obj);
-}
-
-void RGWSI_SysObj::Obj::invalidate()
-{
- ctx.invalidate(obj);
+ return Obj(core_svc, obj);
}
RGWSI_SysObj::Obj::ROp::ROp(Obj& _source) : source(_source) {
class RGWSI_Zone;
class RGWSI_SysObj;
-class RGWSysObjectCtx;
struct rgw_cache_entry_info;
friend class ROp;
RGWSI_SysObj_Core *core_svc;
- RGWSysObjectCtx& ctx;
rgw_raw_obj obj;
public:
- Obj(RGWSI_SysObj_Core *_core_svc,
- RGWSysObjectCtx& _ctx,
- const rgw_raw_obj& _obj) : core_svc(_core_svc),
- ctx(_ctx),
- obj(_obj) {}
-
- void invalidate();
-
- RGWSysObjectCtx& get_ctx() {
- return ctx;
- }
+ Obj(RGWSI_SysObj_Core *_core_svc, const rgw_raw_obj& _obj)
+ : core_svc(_core_svc), obj(_obj) {}
rgw_raw_obj& get_obj() {
return obj;
public:
RGWSI_SysObj(CephContext *cct): RGWServiceInstance(cct) {}
- RGWSysObjectCtx init_obj_ctx();
- Obj get_obj(RGWSysObjectCtx& obj_ctx, const rgw_raw_obj& obj);
+ Obj get_obj(const rgw_raw_obj& obj);
Pool get_pool(const rgw_pool& pool) {
return Pool(core_svc, pool);
};
using RGWSysObj = RGWSI_SysObj::Obj;
-
-class RGWSysObjectCtx : public RGWSysObjectCtxBase
-{
- RGWSI_SysObj *sysobj_svc;
-public:
- RGWSysObjectCtx(RGWSI_SysObj *_sysobj_svc) : sysobj_svc(_sysobj_svc) {}
-
- RGWSI_SysObj::Obj get_obj(const rgw_raw_obj& obj) {
- return sysobj_svc->get_obj(*this, obj);
- }
-};
RGWSI_SysObj_Core_PoolListImplInfo(const std::string& prefix) : op(pool.op()), filter(prefix) {}
};
-
-struct RGWSysObjState {
- rgw_raw_obj obj;
- bool has_attrs{false};
- bool exists{false};
- uint64_t size{0};
- ceph::real_time mtime;
- uint64_t epoch{0};
- bufferlist obj_tag;
- bool has_data{false};
- bufferlist data;
- bool prefetch_data{false};
- uint64_t pg_ver{0};
-
- /* important! don't forget to update copy constructor */
-
- RGWObjVersionTracker objv_tracker;
-
- std::map<std::string, bufferlist> attrset;
- RGWSysObjState() {}
- RGWSysObjState(const RGWSysObjState& rhs) : obj (rhs.obj) {
- has_attrs = rhs.has_attrs;
- exists = rhs.exists;
- size = rhs.size;
- mtime = rhs.mtime;
- epoch = rhs.epoch;
- if (rhs.obj_tag.length()) {
- obj_tag = rhs.obj_tag;
- }
- has_data = rhs.has_data;
- if (rhs.data.length()) {
- data = rhs.data;
- }
- prefetch_data = rhs.prefetch_data;
- pg_ver = rhs.pg_ver;
- objv_tracker = rhs.objv_tracker;
- }
-};
-
-
-class RGWSysObjectCtxBase {
- std::map<rgw_raw_obj, RGWSysObjState> objs_state;
- ceph::shared_mutex lock = ceph::make_shared_mutex("RGWSysObjectCtxBase");
-
-public:
- RGWSysObjectCtxBase() = default;
-
- RGWSysObjectCtxBase(const RGWSysObjectCtxBase& rhs) : objs_state(rhs.objs_state) {}
- RGWSysObjectCtxBase(RGWSysObjectCtxBase&& rhs) : objs_state(std::move(rhs.objs_state)) {}
-
- RGWSysObjState *get_state(const rgw_raw_obj& obj) {
- RGWSysObjState *result;
- std::map<rgw_raw_obj, RGWSysObjState>::iterator iter;
- lock.lock_shared();
- assert (!obj.empty());
- iter = objs_state.find(obj);
- if (iter != objs_state.end()) {
- result = &iter->second;
- lock.unlock_shared();
- } else {
- lock.unlock_shared();
- lock.lock();
- result = &objs_state[obj];
- lock.unlock();
- }
- return result;
- }
-
- void set_prefetch_data(rgw_raw_obj& obj) {
- std::unique_lock wl{lock};
- assert (!obj.empty());
- objs_state[obj].prefetch_data = true;
- }
- void invalidate(const rgw_raw_obj& obj) {
- std::unique_lock wl{lock};
- auto iter = objs_state.find(obj);
- if (iter == objs_state.end()) {
- return;
- }
- objs_state.erase(iter);
- }
-};
-
const DoutPrefixProvider *dpp) = 0;
virtual int add_bucket(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const rgw_bucket& bucket,
ceph::real_time creation_time,
optional_yield y) = 0;
virtual int remove_bucket(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const rgw_bucket& _bucket, optional_yield) = 0;
virtual int list_buckets(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const std::string& marker,
const std::string& end_marker,
optional_yield y) = 0;
virtual int flush_bucket_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const RGWBucketEnt& ent, optional_yield y) = 0;
- virtual int complete_flush_stats(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx,
+ virtual int complete_flush_stats(const DoutPrefixProvider *dpp,
const rgw_user& user, optional_yield y) = 0;
virtual int reset_bucket_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
optional_yield y) = 0;
virtual int read_stats(const DoutPrefixProvider *dpp,
ceph::real_time *last_stats_update,
optional_yield y) = 0; /* last time a stats update was done */
- virtual int read_stats_async(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx,
+ virtual int read_stats_async(const DoutPrefixProvider *dpp,
const rgw_user& user, RGWGetUserStats_CB *cb) = 0;
};
bufferlist link_bl;
encode(ui, link_bl);
- auto& obj_ctx = *ctx->obj_ctx;
-
if (!info.user_email.empty()) {
if (!old_info ||
old_info->user_email.compare(info.user_email) != 0) { /* only if new index changed */
- ret = rgw_put_system_obj(dpp, obj_ctx, svc.zone->get_zone_params().user_email_pool, info.user_email,
+ ret = rgw_put_system_obj(dpp, svc.sysobj, svc.zone->get_zone_params().user_email_pool, info.user_email,
link_bl, exclusive, NULL, real_time(), y);
if (ret < 0)
return ret;
if (old_info && old_info->access_keys.count(iter->first) != 0 && !renamed)
continue;
- ret = rgw_put_system_obj(dpp, obj_ctx, svc.zone->get_zone_params().user_keys_pool, k.id,
+ ret = rgw_put_system_obj(dpp, svc.sysobj, svc.zone->get_zone_params().user_keys_pool, k.id,
link_bl, exclusive, NULL, real_time(), y);
if (ret < 0)
return ret;
if (old_info && old_info->swift_keys.count(siter->first) != 0 && !renamed)
continue;
- ret = rgw_put_system_obj(dpp, obj_ctx, svc.zone->get_zone_params().user_swift_pool, k.id,
+ ret = rgw_put_system_obj(dpp, svc.sysobj, svc.zone->get_zone_params().user_swift_pool, k.id,
link_bl, exclusive, NULL, real_time(), y);
if (ret < 0)
return ret;
if (!old_info.user_email.empty() &&
old_info.user_email != new_info.user_email) {
- ret = svc.user->remove_email_index(dpp, ctx, old_info.user_email, y);
+ ret = svc.user->remove_email_index(dpp, old_info.user_email, y);
if (ret < 0 && ret != -ENOENT) {
set_err_msg("ERROR: could not remove index for email " + old_info.user_email);
return ret;
for ([[maybe_unused]] const auto& [name, access_key] : old_info.access_keys) {
if (!new_info.access_keys.count(access_key.id)) {
- ret = svc.user->remove_key_index(dpp, ctx, access_key, y);
+ ret = svc.user->remove_key_index(dpp, access_key, y);
if (ret < 0 && ret != -ENOENT) {
set_err_msg("ERROR: could not remove index for key " + access_key.id);
return ret;
const auto& swift_key = old_iter->second;
auto new_iter = new_info.swift_keys.find(swift_key.id);
if (new_iter == new_info.swift_keys.end()) {
- ret = svc.user->remove_swift_name_index(dpp, ctx, swift_key.id, y);
+ ret = svc.user->remove_swift_name_index(dpp, swift_key.id, y);
if (ret < 0 && ret != -ENOENT) {
set_err_msg("ERROR: could not remove index for swift_name " + swift_key.id);
return ret;
}
int RGWSI_User_RADOS::remove_key_index(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *_ctx,
const RGWAccessKey& access_key,
optional_yield y)
{
- RGWSI_MetaBackend_SObj::Context_SObj *ctx = static_cast<RGWSI_MetaBackend_SObj::Context_SObj *>(_ctx);
rgw_raw_obj obj(svc.zone->get_zone_params().user_keys_pool, access_key.id);
- auto sysobj = ctx->obj_ctx->get_obj(obj);
+ auto sysobj = svc.sysobj->get_obj(obj);
return sysobj.wop().remove(dpp, y);
}
int RGWSI_User_RADOS::remove_email_index(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *_ctx,
const string& email,
optional_yield y)
{
if (email.empty()) {
return 0;
}
- RGWSI_MetaBackend_SObj::Context_SObj *ctx = static_cast<RGWSI_MetaBackend_SObj::Context_SObj *>(_ctx);
rgw_raw_obj obj(svc.zone->get_zone_params().user_email_pool, email);
- auto sysobj = ctx->obj_ctx->get_obj(obj);
+ auto sysobj = svc.sysobj->get_obj(obj);
return sysobj.wop().remove(dpp, y);
}
-int RGWSI_User_RADOS::remove_swift_name_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *_ctx, const string& swift_name,
+int RGWSI_User_RADOS::remove_swift_name_index(const DoutPrefixProvider *dpp,
+ const string& swift_name,
optional_yield y)
{
- RGWSI_MetaBackend_SObj::Context_SObj *ctx = static_cast<RGWSI_MetaBackend_SObj::Context_SObj *>(_ctx);
rgw_raw_obj obj(svc.zone->get_zone_params().user_swift_pool, swift_name);
- auto sysobj = ctx->obj_ctx->get_obj(obj);
+ auto sysobj = svc.sysobj->get_obj(obj);
return sysobj.wop().remove(dpp, y);
}
* from the user and user email pools. This leaves the pools
* themselves alone, as well as any ACLs embedded in object xattrs.
*/
-int RGWSI_User_RADOS::remove_user_info(RGWSI_MetaBackend::Context *_ctx,
+int RGWSI_User_RADOS::remove_user_info(RGWSI_MetaBackend::Context *ctx,
const RGWUserInfo& info,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
auto kiter = info.access_keys.begin();
for (; kiter != info.access_keys.end(); ++kiter) {
ldpp_dout(dpp, 10) << "removing key index: " << kiter->first << dendl;
- ret = remove_key_index(dpp, _ctx, kiter->second, y);
+ ret = remove_key_index(dpp, kiter->second, y);
if (ret < 0 && ret != -ENOENT) {
ldpp_dout(dpp, 0) << "ERROR: could not remove " << kiter->first << " (access key object), should be fixed (err=" << ret << ")" << dendl;
return ret;
auto& k = siter->second;
ldpp_dout(dpp, 10) << "removing swift subuser index: " << k.id << dendl;
/* check if swift mapping exists */
- ret = remove_swift_name_index(dpp, _ctx, k.id, y);
+ ret = remove_swift_name_index(dpp, k.id, y);
if (ret < 0 && ret != -ENOENT) {
ldpp_dout(dpp, 0) << "ERROR: could not remove " << k.id << " (swift name object), should be fixed (err=" << ret << ")" << dendl;
return ret;
}
ldpp_dout(dpp, 10) << "removing email index: " << info.user_email << dendl;
- ret = remove_email_index(dpp, _ctx, info.user_email, y);
+ ret = remove_email_index(dpp, info.user_email, y);
if (ret < 0 && ret != -ENOENT) {
ldpp_dout(dpp, 0) << "ERROR: could not remove email index object for "
<< info.user_email << ", should be fixed (err=" << ret << ")" << dendl;
rgw_raw_obj uid_bucks = get_buckets_obj(info.user_id);
ldpp_dout(dpp, 10) << "removing user buckets index" << dendl;
- RGWSI_MetaBackend_SObj::Context_SObj *ctx = static_cast<RGWSI_MetaBackend_SObj::Context_SObj *>(_ctx);
- auto sysobj = ctx->obj_ctx->get_obj(uid_bucks);
+ auto sysobj = svc.sysobj->get_obj(uid_bucks);
ret = sysobj.wop().remove(dpp, y);
if (ret < 0 && ret != -ENOENT) {
ldpp_dout(dpp, 0) << "ERROR: could not remove " << info.user_id << ":" << uid_bucks << ", should be fixed (err=" << ret << ")" << dendl;
return 0;
}
-int RGWSI_User_RADOS::get_user_info_from_index(RGWSI_MetaBackend::Context *_ctx,
- const string& key,
- const rgw_pool& pool,
- RGWUserInfo *info,
- RGWObjVersionTracker * const objv_tracker,
- real_time * const pmtime, optional_yield y, const DoutPrefixProvider *dpp)
+int RGWSI_User_RADOS::get_user_info_from_index(RGWSI_MetaBackend::Context* ctx,
+ const string& key,
+ const rgw_pool& pool,
+ RGWUserInfo *info,
+ RGWObjVersionTracker* objv_tracker,
+ real_time* pmtime, optional_yield y,
+ const DoutPrefixProvider* dpp)
{
- RGWSI_MetaBackend_SObj::Context_SObj *ctx = static_cast<RGWSI_MetaBackend_SObj::Context_SObj *>(_ctx);
-
string cache_key = pool.to_str() + "/" + key;
if (auto e = uinfo_cache->find(cache_key)) {
bufferlist bl;
RGWUID uid;
- int ret = rgw_get_system_obj(*ctx->obj_ctx, pool, key, bl, nullptr, &e.mtime, y, dpp);
+ int ret = rgw_get_system_obj(svc.sysobj, pool, key, bl, nullptr, &e.mtime, y, dpp);
if (ret < 0)
return ret;
}
int RGWSI_User_RADOS::add_bucket(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const rgw_bucket& bucket,
ceph::real_time creation_time,
int RGWSI_User_RADOS::remove_bucket(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const rgw_bucket& _bucket,
optional_yield y)
}
int RGWSI_User_RADOS::list_buckets(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const string& marker,
const string& end_marker,
}
int RGWSI_User_RADOS::flush_bucket_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const RGWBucketEnt& ent,
optional_yield y)
}
int RGWSI_User_RADOS::reset_bucket_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
optional_yield y)
{
}
int RGWSI_User_RADOS::complete_flush_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user, optional_yield y)
{
rgw_raw_obj obj = get_buckets_obj(user);
}
};
-int RGWSI_User_RADOS::read_stats_async(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx,
+int RGWSI_User_RADOS::read_stats_async(const DoutPrefixProvider *dpp,
const rgw_user& user, RGWGetUserStats_CB *_cb)
{
string user_str = user.to_str();
int remove_uid_index(RGWSI_MetaBackend::Context *ctx, const RGWUserInfo& user_info, RGWObjVersionTracker *objv_tracker,
optional_yield y, const DoutPrefixProvider *dpp);
- int remove_key_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const RGWAccessKey& access_key, optional_yield y);
- int remove_email_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& email, optional_yield y);
- int remove_swift_name_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& swift_name, optional_yield y);
+ int remove_key_index(const DoutPrefixProvider *dpp, const RGWAccessKey& access_key, optional_yield y);
+ int remove_email_index(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y);
+ int remove_swift_name_index(const DoutPrefixProvider *dpp, const std::string& swift_name, optional_yield y);
/* admin management */
int cls_user_update_buckets(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, std::list<cls_user_bucket_entry>& entries, bool add, optional_yield y);
/* user buckets directory */
int add_bucket(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const rgw_bucket& bucket,
ceph::real_time creation_time,
optional_yield y) override;
int remove_bucket(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const rgw_bucket& _bucket,
optional_yield y) override;
int list_buckets(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const std::string& marker,
const std::string& end_marker,
/* quota related */
int flush_bucket_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
const RGWBucketEnt& ent, optional_yield y) override;
int complete_flush_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user, optional_yield y) override;
int reset_bucket_stats(const DoutPrefixProvider *dpp,
- RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
optional_yield y) override;
int read_stats(const DoutPrefixProvider *dpp,
ceph::real_time *last_stats_update,
optional_yield y) override; /* last time a stats update was done */
- int read_stats_async(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx,
- const rgw_user& user, RGWGetUserStats_CB *cb) override;
+ int read_stats_async(const DoutPrefixProvider *dpp, const rgw_user& user,
+ RGWGetUserStats_CB *cb) override;
};
string oid = "converted";
bufferlist bl;
- RGWSysObjectCtx obj_ctx = sysobj_svc->init_obj_ctx();
- RGWSysObj sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ RGWSysObj sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0 && ret != -ENOENT) {
rgw_pool pool(pool_name);
bufferlist bl;
- RGWSysObjectCtx obj_ctx = sysobj_svc->init_obj_ctx();
- RGWSysObj sysobj = sysobj_svc->get_obj(obj_ctx, rgw_raw_obj(pool, oid));
+ RGWSysObj sysobj = sysobj_svc->get_obj(rgw_raw_obj(pool, oid));
int ret = sysobj.rop().read(dpp, &bl, y);
if (ret < 0 && ret != -ENOENT) {
rgw_raw_obj obj(zone_params->domain_root, avail_pools);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(obj);
-
+ auto sysobj = sysobj_svc->get_obj(obj);
int ret = sysobj.rop().read(dpp, &map_bl, y);
if (ret < 0) {
goto read_omap;
map<string, bufferlist> m;
rgw_raw_obj obj(zone_params->domain_root, avail_pools);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(obj);
-
+ auto sysobj = sysobj_svc->get_obj(obj);
int ret = sysobj.omap().get_all(dpp, &m, y);
if (ret < 0)
return ret;
}
rgw_raw_obj obj(zone_params->domain_root, avail_pools);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = sysobj_svc->get_obj(obj);
bufferlist empty_bl;
ret = sysobj.omap().set(dpp, new_pool.to_str(), empty_bl, y);
int RGWSI_Zone::remove_bucket_placement(const DoutPrefixProvider *dpp, const rgw_pool& old_pool, optional_yield y)
{
rgw_raw_obj obj(zone_params->domain_root, avail_pools);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(obj);
-
+ auto sysobj = sysobj_svc->get_obj(obj);
int ret = sysobj.omap().del(dpp, old_pool.to_str(), y);
// don't care about return value
map<string, bufferlist> m;
rgw_raw_obj obj(zone_params->domain_root, avail_pools);
- auto obj_ctx = sysobj_svc->init_obj_ctx();
- auto sysobj = obj_ctx.get_obj(obj);
+ auto sysobj = sysobj_svc->get_obj(obj);
int ret = sysobj.omap().get_all(dpp, &m, y);
if (ret < 0)
return ret;