RGWSI_User_RADOS::~RGWSI_User_RADOS() {
}
-void RGWSI_User_RADOS::init(RGWSI_RADOS *_rados_svc,
+void RGWSI_User_RADOS::init(librados::Rados* rados_,
RGWSI_Zone *_zone_svc, RGWSI_SysObj *_sysobj_svc,
RGWSI_SysObj_Cache *_cache_svc, RGWSI_Meta *_meta_svc,
RGWSI_MetaBackend *_meta_be_svc,
RGWSI_SyncModules *_sync_modules_svc)
{
svc.user = this;
- svc.rados = _rados_svc;
+ rados = rados_;
svc.zone = _zone_svc;
svc.sysobj = _sysobj_svc;
svc.cache = _cache_svc;
int RGWSI_User_RADOS::cls_user_update_buckets(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, list<cls_user_bucket_entry>& entries, bool add, optional_yield y)
{
- auto rados_obj = svc.rados->obj(obj);
- int r = rados_obj.open(dpp);
+ rgw_rados_ref rados_obj;
+ int r = rgw_get_rados_ref(dpp, rados, obj, &rados_obj);
if (r < 0) {
return r;
}
int RGWSI_User_RADOS::cls_user_remove_bucket(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, const cls_user_bucket& bucket, optional_yield y)
{
- auto rados_obj = svc.rados->obj(obj);
- int r = rados_obj.open(dpp);
+ rgw_rados_ref rados_obj;
+ int r = rgw_get_rados_ref(dpp, rados, obj, &rados_obj);
if (r < 0) {
return r;
}
bool * const truncated,
optional_yield y)
{
- auto rados_obj = svc.rados->obj(obj);
- int r = rados_obj.open(dpp);
+ rgw_rados_ref rados_obj;
+ int r = rgw_get_rados_ref(dpp, rados, obj, &rados_obj);
if (r < 0) {
return r;
}
int RGWSI_User_RADOS::cls_user_reset_stats(const DoutPrefixProvider *dpp, const rgw_user& user, optional_yield y)
{
rgw_raw_obj obj = get_buckets_obj(user);
- auto rados_obj = svc.rados->obj(obj);
- int rval, r = rados_obj.open(dpp);
+ rgw_rados_ref rados_obj;
+ int r = rgw_get_rados_ref(dpp, rados, obj, &rados_obj);
if (r < 0) {
return r;
}
+ int rval;
+
cls_user_reset_stats2_op call;
cls_user_reset_stats2_ret ret;
const rgw_user& user, optional_yield y)
{
rgw_raw_obj obj = get_buckets_obj(user);
- auto rados_obj = svc.rados->obj(obj);
- int r = rados_obj.open(dpp);
+ rgw_rados_ref rados_obj;
+ int r = rgw_get_rados_ref(dpp, rados, obj, &rados_obj);
if (r < 0) {
return r;
}
+
librados::ObjectWriteOperation op;
::cls_user_complete_stats_sync(op);
return rados_obj.operate(dpp, &op, y);
optional_yield y)
{
rgw_raw_obj obj = get_buckets_obj(user);
- auto rados_obj = svc.rados->obj(obj);
- int r = rados_obj.open(dpp);
+ rgw_rados_ref rados_obj;
+ int r = rgw_get_rados_ref(dpp, rados, obj, &rados_obj);
if (r < 0) {
return r;
}
int RGWSI_User_RADOS::cls_user_get_header_async(const DoutPrefixProvider *dpp, const string& user_str, RGWGetUserHeader_CB *cb)
{
rgw_raw_obj obj = get_buckets_obj(rgw_user(user_str));
- auto rados_obj = svc.rados->obj(obj);
- int r = rados_obj.open(dpp);
+ rgw_rados_ref ref;
+ int r = rgw_get_rados_ref(dpp, rados, obj, &ref);
if (r < 0) {
return r;
}
- auto& ref = rados_obj.get_ref();
-
- r = ::cls_user_get_header_async(ref.pool.ioctx(), ref.obj.oid, cb);
+ r = ::cls_user_get_header_async(ref.ioctx, ref.obj.oid, cb);
if (r < 0) {
return r;
}
#include "driver/rados/rgw_bucket.h" // FIXME: subclass dependency
-class RGWSI_RADOS;
class RGWSI_Zone;
class RGWSI_SysObj;
class RGWSI_SysObj_Cache;
int do_start(optional_yield, const DoutPrefixProvider *dpp) override;
public:
+ librados::Rados* rados{nullptr};
+
struct Svc {
RGWSI_User_RADOS *user{nullptr};
- RGWSI_RADOS *rados{nullptr};
RGWSI_Zone *zone{nullptr};
RGWSI_SysObj *sysobj{nullptr};
RGWSI_SysObj_Cache *cache{nullptr};
RGWSI_User_RADOS(CephContext *cct);
~RGWSI_User_RADOS();
- void init(RGWSI_RADOS *_rados_svc,
+ void init(librados::Rados* rados_,
RGWSI_Zone *_zone_svc, RGWSI_SysObj *_sysobj_svc,
RGWSI_SysObj_Cache *_cache_svc, RGWSI_Meta *_meta_svc,
RGWSI_MetaBackend *_meta_be_svc,