#define BUCKET_TAG_TIMEOUT 30
-using namespace rgw::sal;
-
/*
* The tenant_name is always returned on purpose. May be empty, of course.
* Get all the buckets owned by a user and fill up an RGWUserBuckets with them.
* Returns: 0 on success, -ERR# on failure.
*/
-int rgw_read_user_buckets(RGWRadosStore * store,
+int rgw_read_user_buckets(rgw::sal::RGWRadosStore * store,
const rgw_user& user_id,
rgw::sal::RGWBucketList& buckets,
const string& marker,
}
}
-void check_bad_user_bucket_mapping(RGWRadosStore *store, const rgw_user& user_id,
+void check_bad_user_bucket_mapping(rgw::sal::RGWRadosStore *store, const rgw_user& user_id,
bool fix)
{
rgw::sal::RGWBucketList user_buckets;
return;
}
- map<string, RGWSalBucket*>& buckets = user_buckets.get_buckets();
- for (map<string, RGWSalBucket*>::iterator i = buckets.begin();
+ map<string, rgw::sal::RGWBucket*>& buckets = user_buckets.get_buckets();
+ for (map<string, rgw::sal::RGWBucket*>::iterator i = buckets.begin();
i != buckets.end();
++i) {
marker = i->first;
- RGWSalBucket* bucket = i->second;
+ rgw::sal::RGWBucket* bucket = i->second;
RGWBucketInfo bucket_info;
real_time mtime;
return rgw_obj_key::oid_to_key_in_ns(oid, &key, ns);
}
-int rgw_remove_object(RGWRadosStore *store, const RGWBucketInfo& bucket_info, const rgw_bucket& bucket, rgw_obj_key& key)
+int rgw_remove_object(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& bucket_info, const rgw_bucket& bucket, rgw_obj_key& key)
{
RGWObjectCtx rctx(store);
}
/* xxx dang */
-static int rgw_remove_bucket(RGWRadosStore *store, rgw_bucket& bucket, bool delete_children, optional_yield y)
+static int rgw_remove_bucket(rgw::sal::RGWRadosStore *store, rgw_bucket& bucket, bool delete_children, optional_yield y)
{
int ret;
map<RGWObjCategory, RGWStorageStats> stats;
return ret;
}
-int rgw_remove_bucket_bypass_gc(RGWRadosStore *store, rgw_bucket& bucket,
+int rgw_remove_bucket_bypass_gc(rgw::sal::RGWRadosStore *store, rgw_bucket& bucket,
int concurrent_max, bool keep_index_consistent,
optional_yield y)
{
*sink = msg;
}
-int RGWBucket::init(RGWRadosStore *storage, RGWBucketAdminOpState& op_state,
+int RGWBucket::init(rgw::sal::RGWRadosStore *storage, RGWBucketAdminOpState& op_state,
optional_yield y, std::string *err_msg,
map<string, bufferlist> *pattrs)
{
}
-int RGWBucketAdminOp::get_policy(RGWRadosStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::get_policy(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state,
RGWAccessControlPolicy& policy)
{
RGWBucket bucket;
/* Wrappers to facilitate RESTful interface */
-int RGWBucketAdminOp::get_policy(RGWRadosStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::get_policy(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher)
{
RGWAccessControlPolicy policy(store->ctx());
return 0;
}
-int RGWBucketAdminOp::dump_s3_policy(RGWRadosStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::dump_s3_policy(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state,
ostream& os)
{
RGWAccessControlPolicy_S3 policy(store->ctx());
return 0;
}
-int RGWBucketAdminOp::unlink(RGWRadosStore *store, RGWBucketAdminOpState& op_state)
+int RGWBucketAdminOp::unlink(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state)
{
RGWBucket bucket;
return bucket.unlink(op_state, null_yield);
}
-int RGWBucketAdminOp::link(RGWRadosStore *store, RGWBucketAdminOpState& op_state, string *err)
+int RGWBucketAdminOp::link(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state, string *err)
{
RGWBucket bucket;
map<string, bufferlist> attrs;
}
-int RGWBucketAdminOp::check_index(RGWRadosStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::check_index(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y)
{
int ret;
return 0;
}
-int RGWBucketAdminOp::remove_bucket(RGWRadosStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::remove_bucket(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state,
optional_yield y, bool bypass_gc, bool keep_index_consistent)
{
RGWBucket bucket;
return ret;
}
-int RGWBucketAdminOp::remove_object(RGWRadosStore *store, RGWBucketAdminOpState& op_state)
+int RGWBucketAdminOp::remove_object(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state)
{
RGWBucket bucket;
return bucket.remove_object(op_state);
}
-int RGWBucketAdminOp::sync_bucket(RGWRadosStore *store, RGWBucketAdminOpState& op_state, string *err_msg)
+int RGWBucketAdminOp::sync_bucket(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state, string *err_msg)
{
RGWBucket bucket;
map<string, bufferlist> attrs;
return bucket.sync(op_state, &attrs, err_msg);
}
-static int bucket_stats(RGWRadosStore *store, const std::string& tenant_name, std::string& bucket_name, Formatter *formatter)
+static int bucket_stats(rgw::sal::RGWRadosStore *store, const std::string& tenant_name, std::string& bucket_name, Formatter *formatter)
{
RGWBucketInfo bucket_info;
map<RGWObjCategory, RGWStorageStats> stats;
return 0;
}
-int RGWBucketAdminOp::limit_check(RGWRadosStore *store,
+int RGWBucketAdminOp::limit_check(rgw::sal::RGWRadosStore *store,
RGWBucketAdminOpState& op_state,
const std::list<std::string>& user_ids,
RGWFormatterFlusher& flusher,
if (ret < 0)
return ret;
- map<string, rgw::sal::RGWSalBucket*>& m_buckets = buckets.get_buckets();
+ map<string, rgw::sal::RGWBucket*>& m_buckets = buckets.get_buckets();
for (const auto& iter : m_buckets) {
auto bucket = iter.second;
return ret;
} /* RGWBucketAdminOp::limit_check */
-int RGWBucketAdminOp::info(RGWRadosStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::info(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher)
{
int ret = 0;
if (ret < 0)
return ret;
- map<string, RGWSalBucket*>& m = buckets.get_buckets();
- map<string, RGWSalBucket*>::iterator iter;
+ map<string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
+ map<string, rgw::sal::RGWBucket*>::iterator iter;
for (iter = m.begin(); iter != m.end(); ++iter) {
std::string obj_name = iter->first;
return 0;
}
-int RGWBucketAdminOp::set_quota(RGWRadosStore *store, RGWBucketAdminOpState& op_state)
+int RGWBucketAdminOp::set_quota(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state)
{
RGWBucket bucket;
return bucket.set_quota(op_state);
}
-static int purge_bucket_instance(RGWRadosStore *store, const RGWBucketInfo& bucket_info)
+static int purge_bucket_instance(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& bucket_info)
{
int max_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
for (int i = 0; i < max_shards; i++) {
}
using bucket_instance_ls = std::vector<RGWBucketInfo>;
-void get_stale_instances(RGWRadosStore *store, const std::string& bucket_name,
+void get_stale_instances(rgw::sal::RGWRadosStore *store, const std::string& bucket_name,
const vector<std::string>& lst,
bucket_instance_ls& stale_instances)
{
return;
}
-static int process_stale_instances(RGWRadosStore *store, RGWBucketAdminOpState& op_state,
+static int process_stale_instances(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher,
std::function<void(const bucket_instance_ls&,
Formatter *,
- RGWRadosStore*)> process_f)
+ rgw::sal::RGWRadosStore*)> process_f)
{
std::string marker;
void *handle;
return 0;
}
-int RGWBucketAdminOp::list_stale_instances(RGWRadosStore *store,
+int RGWBucketAdminOp::list_stale_instances(rgw::sal::RGWRadosStore *store,
RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher)
{
auto process_f = [](const bucket_instance_ls& lst,
Formatter *formatter,
- RGWRadosStore*){
+ rgw::sal::RGWRadosStore*){
for (const auto& binfo: lst)
formatter->dump_string("key", binfo.bucket.get_key());
};
}
-int RGWBucketAdminOp::clear_stale_instances(RGWRadosStore *store,
+int RGWBucketAdminOp::clear_stale_instances(rgw::sal::RGWRadosStore *store,
RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher)
{
auto process_f = [](const bucket_instance_ls& lst,
Formatter *formatter,
- RGWRadosStore *store){
+ rgw::sal::RGWRadosStore *store){
for (const auto &binfo: lst) {
int ret = purge_bucket_instance(store, binfo);
if (ret == 0){
extern std::string rgw_make_bucket_entry_name(const std::string& tenant_name,
const std::string& bucket_name);
-static inline void rgw_make_bucket_entry_name(const string& tenant_name,
- const string& bucket_name,
- std::string& bucket_entry) {
- bucket_entry = rgw_make_bucket_entry_name(tenant_name, bucket_name);
-}
extern void rgw_parse_url_bucket(const string& bucket,
const string& auth_tenant,
void send_response_data(rgw::sal::RGWBucketList& buckets) override {
if (!sent_data)
return;
- map<string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
+ map<string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
for (const auto& iter : m) {
boost::string_ref marker{iter.first};
- rgw::sal::RGWSalBucket* ent = iter.second;
+ rgw::sal::RGWBucket* ent = iter.second;
if (! this->operator()(ent->get_name(), marker)) {
/* caller cannot accept more */
lsubdout(cct, rgw, 5) << "ListBuckets rcb failed"
};
using namespace librados;
-using namespace rgw::sal;
bool LCRule::valid() const
{
return NULL;
}
-void RGWLC::initialize(CephContext *_cct, RGWRadosStore *_store) {
+void RGWLC::initialize(CephContext *_cct, rgw::sal::RGWRadosStore *_store) {
cct = _cct;
store = _store;
max_objs = cct->_conf->rgw_lc_max_objs;
}
class LCObjsLister {
- RGWRadosStore *store;
+ rgw::sal::RGWRadosStore *store;
RGWBucketInfo& bucket_info;
RGWRados::Bucket target;
RGWRados::Bucket::List list_op;
int64_t delay_ms;
public:
- LCObjsLister(RGWRadosStore *_store, RGWBucketInfo& _bucket_info) :
+ LCObjsLister(rgw::sal::RGWRadosStore *_store, RGWBucketInfo& _bucket_info) :
store(_store), bucket_info(_bucket_info),
target(store->getRados(), bucket_info), list_op(&target) {
list_op.params.list_versions = bucket_info.versioned();
struct op_env {
lc_op& op;
- RGWRadosStore *store;
+ rgw::sal::RGWRadosStore *store;
RGWLC *lc;
RGWBucketInfo& bucket_info;
LCObjsLister& ol;
- op_env(lc_op& _op, RGWRadosStore *_store, RGWLC *_lc, RGWBucketInfo& _bucket_info,
+ op_env(lc_op& _op, rgw::sal::RGWRadosStore *_store, RGWLC *_lc, RGWBucketInfo& _bucket_info,
LCObjsLister& _ol) : op(_op), store(_store), lc(_lc), bucket_info(_bucket_info), ol(_ol) {}
};
op_env& env;
rgw_bucket_dir_entry& o;
- RGWRadosStore *store;
+ rgw::sal::RGWRadosStore *store;
RGWBucketInfo& bucket_info;
lc_op& op;
LCObjsLister& ol;
}
template<typename F>
-static int guard_lc_modify(RGWRadosStore* store, const rgw_bucket& bucket, const string& cookie, const F& f) {
+static int guard_lc_modify(rgw::sal::RGWRadosStore* store, const rgw_bucket& bucket, const string& cookie, const F& f) {
CephContext *cct = store->ctx();
string shard_id = get_lc_shard_name(bucket);
} else {
bucket_id = s->bucket.bucket_id;
}
- rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name, entry.bucket);
+ entry.bucket = rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name);
if (check_utf8(entry.bucket.c_str(), entry.bucket.size()) != 0) {
ldout(s->cct, 5) << "not logging op on bucket with non-utf8 name" << dendl;
#include <boost/asio/yield.hpp>
-using namespace rgw::sal;
-
#define dout_subsys ceph_subsys_rgw
const std::string RGWMetadataLogHistory::oid = "meta.history";
return 0;
}
-static int get_bucket_instance_policy_from_attr(CephContext *cct,
- RGWUserCtl *user_ctl,
- RGWBucketInfo& bucket_info,
- map<string, bufferlist>& bucket_attrs,
- RGWAccessControlPolicy *policy)
+/**
+ * Get the AccessControlPolicy for an object off of disk.
+ * policy: must point to a valid RGWACL, and will be filled upon return.
+ * bucket: name of the bucket containing the object.
+ * object: name of the object to get the ACL for.
+ * Returns: 0 on success, -ERR# otherwise.
+ */
+int rgw_op_get_bucket_policy_from_attr(CephContext *cct,
+ RGWUserCtl *user_ctl,
+ RGWBucketInfo& bucket_info,
+ map<string, bufferlist>& bucket_attrs,
+ RGWAccessControlPolicy *policy)
{
map<string, bufferlist>::iterator aiter = bucket_attrs.find(RGW_ATTR_ACL);
}
-/**
- * Get the AccessControlPolicy for an object off of disk.
- * policy: must point to a valid RGWACL, and will be filled upon return.
- * bucket: name of the bucket containing the object.
- * object: name of the object to get the ACL for.
- * Returns: 0 on success, -ERR# otherwise.
- */
-int rgw_op_get_bucket_policy_from_attr(CephContext *cct,
- RGWUserCtl *user_ctl,
- RGWBucketInfo& bucket_info,
- map<string, bufferlist>& bucket_attrs,
- RGWAccessControlPolicy *policy)
-{
- return get_bucket_instance_policy_from_attr(cct, user_ctl, bucket_info, bucket_attrs, policy);
-}
-
static boost::optional<Policy> get_iam_policy_from_attr(CephContext* cct,
rgw::sal::RGWRadosStore* store,
map<string, bufferlist>& attrs,
if (ret < 0) {
if (ret != -ENOENT) {
string bucket_log;
- rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name, bucket_log);
+ bucket_log = rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name);
ldpp_dout(s, 0) << "NOTICE: couldn't get bucket from bucket_name (name="
<< bucket_log << ")" << dendl;
return ret;
decltype(policies_stats)::mapped_type());
}
- std::map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
+ std::map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
for (const auto& kv : m) {
const auto& bucket = kv.second;
}
if (!m.empty()) {
- map<string, rgw::sal::RGWSalBucket*>::reverse_iterator riter = m.rbegin();
+ map<string, rgw::sal::RGWBucket*>::reverse_iterator riter = m.rbegin();
marker = riter->first;
handle_listing_chunk(std::move(buckets));
decltype(policies_stats)::mapped_type());
}
- std::map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
+ std::map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
for (const auto& kv : m) {
const auto& bucket = kv.second;
buffer::list aclbl;
buffer::list corsbl;
bool existed;
- string bucket_name;
- rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name, bucket_name);
+ string bucket_name = rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name);
rgw_raw_obj obj(store->svc()->zone->get_zone_params().domain_root, bucket_name);
obj_version objv, *pobjv = NULL;
+ rgw::sal::RGWRadosUser user(store, *s->user);
op_ret = get_params();
if (op_ret < 0)
/* we need to make sure we read bucket info, it's not read before for this
* specific request */
- op_ret = store->getRados()->get_bucket_info(store->svc(), s->bucket_tenant, s->bucket_name,
- s->bucket_info, nullptr, s->yield, &s->bucket_attrs);
+ s->bucket.tenant = s->bucket_tenant;
+ s->bucket.name = s->bucket_name;
+ rgw::sal::RGWBucket* bucket = NULL;
+ op_ret = store->get_bucket(user, s->bucket, &bucket);
if (op_ret < 0 && op_ret != -ENOENT)
return;
s->bucket_exists = (op_ret != -ENOENT);
s->bucket_owner.set_id(s->user->user_id);
- s->bucket_owner.set_name(s->user->display_name);
+ s->bucket_owner.set_name(user.get_display_name());
if (s->bucket_exists) {
+ s->bucket_info = bucket->get_info();
+ s->bucket_attrs = bucket->get_attrs();
+ delete bucket;
int r = rgw_op_get_bucket_policy_from_attr(s->cct, store->ctl()->user, s->bucket_info,
s->bucket_attrs, &old_policy);
if (r >= 0) {
class RGWListBucket : public RGWOp {
protected:
- rgw::sal::RGWSalBucket* bucket;
+ rgw::sal::RGWBucket* bucket;
string prefix;
rgw_obj_key marker;
rgw_obj_key next_marker;
class RGWStatBucket : public RGWOp {
protected:
- rgw::sal::RGWSalBucket* bucket;
+ rgw::sal::RGWBucket* bucket;
public:
RGWStatBucket() : bucket(nullptr) {}
s->formatter->close_section();
}
-void dump_bucket(struct req_state *s, rgw::sal::RGWSalBucket& obj)
+void dump_bucket(struct req_state *s, rgw::sal::RGWBucket& obj)
{
s->formatter->open_object_section("Bucket");
s->formatter->dump_string("Name", obj.get_name());
if (!sent_data)
return;
- map<string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
- map<string, rgw::sal::RGWSalBucket*>::iterator iter;
+ map<string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
+ map<string, rgw::sal::RGWBucket*>::iterator iter;
for (iter = m.begin(); iter != m.end(); ++iter) {
- rgw::sal::RGWSalBucket* obj = iter->second;
+ rgw::sal::RGWBucket* obj = iter->second;
dump_bucket(s, *obj);
}
rgw_flush_formatter(s, s->formatter);
rgw_flush_formatter_and_reset(s, s->formatter);
}
-static void dump_bucket_metadata(struct req_state *s, rgw::sal::RGWSalBucket* bucket)
+static void dump_bucket_metadata(struct req_state *s, rgw::sal::RGWBucket* bucket)
{
dump_header(s, "X-RGW-Object-Count", static_cast<long long>(bucket->get_count()));
dump_header(s, "X-RGW-Bytes-Used", static_cast<long long>(bucket->get_size()));
* in applying the filter earlier as we really need to go through all
* entries regardless of it (the headers like X-Account-Container-Count
* aren't affected by specifying prefix). */
- const std::map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
+ const std::map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
for (auto iter = m.lower_bound(prefix);
iter != m.end() && boost::algorithm::starts_with(iter->first, prefix);
++iter) {
}
}
-void RGWListBuckets_ObjStore_SWIFT::dump_bucket_entry(const rgw::sal::RGWSalBucket& obj)
+void RGWListBuckets_ObjStore_SWIFT::dump_bucket_entry(const rgw::sal::RGWBucket& obj)
{
s->formatter->open_object_section("container");
s->formatter->dump_string("name", obj.get_name());
* in applying the filter earlier as we really need to go through all
* entries regardless of it (the headers like X-Account-Container-Count
* aren't affected by specifying prefix). */
- std::map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
+ std::map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
auto iter = m.rbegin();
for (/* initialized above */;
}
static void dump_container_metadata(struct req_state *,
- const rgw::sal::RGWSalBucket*,
+ const rgw::sal::RGWBucket*,
const RGWQuotaInfo&,
const RGWBucketWebsiteConf&);
} // RGWListBucket_ObjStore_SWIFT::send_response
static void dump_container_metadata(struct req_state *s,
- const rgw::sal::RGWSalBucket* bucket,
+ const rgw::sal::RGWBucket* bucket,
const RGWQuotaInfo& quota,
const RGWBucketWebsiteConf& ws_conf)
{
void send_response_begin(bool has_buckets) override;
void send_response_data(rgw::sal::RGWBucketList& buckets) override;
void send_response_data_reversed(rgw::sal::RGWBucketList& buckets);
- void dump_bucket_entry(const rgw::sal::RGWSalBucket& obj);
+ void dump_bucket_entry(const rgw::sal::RGWBucket& obj);
void send_response_end() override;
bool should_get_stats() override { return need_stats; }
buckets.clear();
}
-RGWSalBucket* RGWRadosUser::add_bucket(rgw_bucket& bucket,
+RGWBucket* RGWRadosUser::add_bucket(rgw_bucket& bucket,
ceph::real_time creation_time)
{
return NULL;
}
+std::string& RGWRadosUser::get_display_name()
+{
+ return info.display_name;
+}
+
RGWObject *RGWRadosBucket::create_object(const rgw_obj_key &key)
{
if (!object) {
map<RGWObjCategory, RGWStorageStats> stats;
std::vector<rgw_bucket_dir_entry> objs;
map<string, bool> common_prefixes;
- RGWBucketInfo info;
string bucket_ver, master_ver;
- ret = get_bucket_info(info, y);
+ ret = get_bucket_info(y);
if (ret < 0)
return ret;
return ret;
}
-int RGWRadosBucket::get_bucket_info(RGWBucketInfo &info, optional_yield y)
+int RGWRadosBucket::get_bucket_info(optional_yield y)
{
return store->getRados()->get_bucket_info(store->svc(), ent.bucket.tenant, ent.bucket.name, info,
- NULL, y);
+ NULL, y, &attrs);
}
int RGWRadosBucket::get_bucket_stats(RGWBucketInfo& bucket_info, int shard_id,
return store->getRados()->get_bucket_stats(bucket_info, shard_id, bucket_ver, master_ver, stats, max_marker, syncstopped);
}
-int RGWRadosBucket::sync_user_stats(RGWBucketInfo& bucket_info)
+int RGWRadosBucket::read_bucket_stats(optional_yield y)
{
- return store->ctl()->bucket->sync_user_stats(user.user, bucket_info, &ent);
+ return store->ctl()->bucket->read_bucket_stats(ent.bucket, &ent, y);
+}
+
+int RGWRadosBucket::sync_user_stats()
+{
+ return store->ctl()->bucket->sync_user_stats(user.user, info, &ent);
}
int RGWRadosBucket::update_container_stats(void)
return 0;
}
-int RGWRadosBucket::set_acl(RGWAccessControlPolicy &acl, RGWBucketInfo& bucket_info, optional_yield y)
+int RGWRadosBucket::check_bucket_shards(void)
+{
+ return store->getRados()->check_bucket_shards(info, ent.bucket, get_count());
+}
+
+int RGWRadosBucket::link(RGWUser* new_user, optional_yield y)
+{
+ RGWBucketEntryPoint ep;
+ ep.bucket = ent.bucket;
+ ep.owner = new_user->get_user();
+ ep.creation_time = get_creation_time();
+ ep.linked = true;
+ map<string, bufferlist> ep_attrs;
+ rgw_ep_info ep_data{ep, ep_attrs};
+
+ return store->ctl()->bucket->link_bucket(new_user->get_user(), info.bucket,
+ ceph::real_time(), y, true, &ep_data);
+}
+
+int RGWRadosBucket::unlink(RGWUser* new_user, optional_yield y)
+{
+ return -1;
+}
+
+int RGWRadosBucket::chown(RGWUser* new_user, RGWUser* old_user, optional_yield y)
+{
+ string obj_marker;
+
+ return store->ctl()->bucket->chown(store, info, new_user->get_user(),
+ old_user->get_display_name(), obj_marker, y);
+}
+
+bool RGWRadosBucket::is_owner(RGWUser* user)
+{
+ get_bucket_info(null_yield);
+
+ return (info.owner.compare(user->get_user()) == 0);
+}
+
+int RGWRadosBucket::set_acl(RGWAccessControlPolicy &acl, optional_yield y)
{
bufferlist aclbl;
acls = acl;
acl.encode(aclbl);
- return store->ctl()->bucket->set_acl(acl.get_owner(), ent.bucket, bucket_info, aclbl, null_yield);
+ return store->ctl()->bucket->set_acl(acl.get_owner(), ent.bucket, info, aclbl, null_yield);
}
RGWUser *RGWRadosStore::get_user(const rgw_user &u)
return new RGWRadosUser(this, u);
}
-//RGWSalBucket *RGWRadosStore::create_bucket(RGWUser &u, const rgw_bucket &b)
+//RGWBucket *RGWRadosStore::create_bucket(RGWUser &u, const rgw_bucket &b)
//{
//if (!bucket) {
//bucket = new RGWRadosBucket(this, u, b);
rados->finalize();
}
+int RGWRadosStore::get_bucket(RGWUser& u, const rgw_bucket& b, RGWBucket** bucket)
+{
+ int ret;
+ RGWBucket* bp;
+
+ *bucket = nullptr;
+
+ bp = new RGWRadosBucket(this, u, b);
+ if (!bp) {
+ return -ENOMEM;
+ }
+ ret = bp->get_bucket_info(null_yield);
+ if (ret < 0) {
+ delete bp;
+ return ret;
+ }
+
+ *bucket = bp;
+ return 0;
+}
+
} // namespace rgw::sal
rgw::sal::RGWRadosStore *RGWStoreManager::init_storage_provider(CephContext *cct, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread, bool use_cache)
#define RGW_SAL_VERSION 1
class RGWUser;
-class RGWSalBucket;
+class RGWBucket;
class RGWObject;
class RGWBucketList;
-typedef std::map<string, string> RGWAttrs;
+typedef std::map<std::string, ceph::bufferlist> RGWAttrs;
class RGWStore {
public:
RGWStore() {}
virtual ~RGWStore() = default;
- virtual RGWUser* get_user(const rgw_user &u) = 0;
- virtual RGWSalBucket* get_bucket(RGWUser &u, const rgw_bucket &b) = 0;
- //virtual RGWSalBucket* create_bucket(RGWUser &u, const rgw_bucket &b) = 0;
+ virtual RGWUser* get_user(const rgw_user& u) = 0;
+ virtual int get_bucket(RGWUser& u, const rgw_bucket& b, RGWBucket** bucket) = 0;
+ //virtual RGWBucket* create_bucket(RGWUser& u, const rgw_bucket& b) = 0;
virtual RGWBucketList* list_buckets(void) = 0;
virtual void finalize(void)=0;
class RGWUser {
protected:
rgw_user user;
+ RGWUserInfo info;
public:
RGWUser() : user() {}
- RGWUser(const rgw_user &_u) : user(_u) {}
+ RGWUser(const rgw_user& _u) : user(_u) {}
+ RGWUser(const RGWUserInfo& _i) : user(_i.user_id), info(_i) {}
virtual ~RGWUser() = default;
virtual int list_buckets(const string& marker, const string& end_marker,
- uint64_t max, bool need_stats, RGWBucketList &buckets) = 0;
- virtual RGWSalBucket* add_bucket(rgw_bucket& bucket, ceph::real_time creation_time) = 0;
- friend class RGWSalBucket;
+ uint64_t max, bool need_stats, RGWBucketList& buckets) = 0;
+ virtual RGWBucket* add_bucket(rgw_bucket& bucket, ceph::real_time creation_time) = 0;
+ friend class RGWBucket;
+ virtual std::string& get_display_name() = 0;
std::string& get_tenant() { return user.tenant; }
+
+
/* xxx dang temporary; will be removed when User is complete */
rgw_user& get_user() { return user; }
};
-class RGWSalBucket {
+class RGWBucket {
protected:
RGWBucketEnt ent;
+ RGWBucketInfo info;
+ RGWUser *owner;
+ RGWAttrs attrs;
public:
- RGWSalBucket() : ent() {}
- RGWSalBucket(const rgw_bucket &_b) { ent.bucket = _b; }
- RGWSalBucket(const RGWBucketEnt &_e) : ent(_e) {}
- virtual ~RGWSalBucket() = default;
+ RGWBucket() : ent(), owner(nullptr), attrs() {}
+ RGWBucket(const rgw_bucket& _b) : ent(), attrs() { ent.bucket = _b; }
+ RGWBucket(const RGWBucketEnt& _e) : ent(_e), attrs() {}
+ virtual ~RGWBucket() = default;
- virtual RGWObject* get_object(const rgw_obj_key &key) = 0;
+ virtual RGWObject* get_object(const rgw_obj_key& key) = 0;
virtual RGWBucketList* list(void) = 0;
- virtual RGWObject* create_object(const rgw_obj_key &key /* Attributes */) = 0;
- virtual RGWAttrs& get_attrs(void) = 0;
- virtual int set_attrs(RGWAttrs &attrs) = 0;
+ virtual RGWObject* create_object(const rgw_obj_key& key /* Attributes */) = 0;
+ virtual RGWAttrs& get_attrs(void) { return attrs; }
+ virtual int set_attrs(RGWAttrs& a) { attrs = a; return 0; }
virtual int remove_bucket(bool delete_children, optional_yield y) = 0;
virtual RGWAccessControlPolicy& get_acl(void) = 0;
- virtual int set_acl(RGWAccessControlPolicy &acl, RGWBucketInfo& bucket_info, optional_yield y) = 0;
- virtual int get_bucket_info(RGWBucketInfo &info, optional_yield y) = 0;
+ virtual int set_acl(RGWAccessControlPolicy& acl, optional_yield y) = 0;
+ virtual int get_bucket_info(optional_yield y) = 0;
virtual int get_bucket_stats(RGWBucketInfo& bucket_info, int shard_id,
std::string *bucket_ver, std::string *master_ver,
std::map<RGWObjCategory, RGWStorageStats>& stats,
std::string *max_marker = nullptr,
bool *syncstopped = nullptr) = 0;
- virtual int sync_user_stats(RGWBucketInfo &info) = 0;
+ virtual int read_bucket_stats(optional_yield y) = 0;
+ virtual int sync_user_stats() = 0;
virtual int update_container_stats(void) = 0;
-
- std::string get_name() const { return ent.bucket.name; }
- std::string get_tenant() const { return ent.bucket.tenant; }
- std::string get_marker() const { return ent.bucket.marker; }
- std::string get_bucket_id() const { return ent.bucket.bucket_id; }
+ virtual int check_bucket_shards(void) = 0;
+ virtual int link(RGWUser* new_user, optional_yield y) = 0;
+ virtual int unlink(RGWUser* new_user, optional_yield y) = 0;
+ virtual int chown(RGWUser* new_user, RGWUser* old_user, optional_yield y) = 0;
+ virtual bool is_owner(RGWUser *user) = 0;
+
+ const std::string& get_name() const { return ent.bucket.name; }
+ const std::string& get_tenant() const { return ent.bucket.tenant; }
+ const std::string& get_marker() const { return ent.bucket.marker; }
+ const std::string& get_bucket_id() const { return ent.bucket.bucket_id; }
size_t get_size() const { return ent.size; }
size_t get_size_rounded() const { return ent.size_rounded; }
uint64_t get_count() const { return ent.count; }
rgw_placement_rule get_placement_rule() const { return ent.placement_rule; }
ceph::real_time& get_creation_time() { return ent.creation_time; };
+ void convert(cls_user_bucket_entry *b) const {
+ ent.convert(b);
+ }
+
/* dang - This is temporary, until the API is completed */
rgw_bucket& get_bi() { return ent.bucket; }
+ RGWBucketInfo& get_info() { return info; }
- friend inline ostream& operator<<(ostream& out, const RGWSalBucket &b) {
+ friend inline ostream& operator<<(ostream& out, const RGWBucket& b) {
out << b.ent.bucket;
return out;
}
friend class RGWBucketList;
protected:
- virtual void set_ent(RGWBucketEnt &_ent) { ent = _ent; }
+ virtual void set_ent(RGWBucketEnt& _ent) { ent = _ent; }
};
class RGWBucketList {
- std::map<std::string, RGWSalBucket*> buckets;
+ std::map<std::string, RGWBucket*> buckets;
bool truncated;
public:
RGWBucketList& operator=(const RGWBucketList&) = default;
~RGWBucketList();
- map<string, RGWSalBucket*>& get_buckets() { return buckets; }
- bool is_truncated(void) { return truncated; }
+ map<string, RGWBucket*>& get_buckets() { return buckets; }
+ bool is_truncated(void) const { return truncated; }
void set_truncated(bool trunc) { truncated = trunc; }
- void add(RGWSalBucket* bucket) {
+ void add(RGWBucket* bucket) {
buckets[bucket->ent.bucket.name] = bucket;
}
- size_t count() { return buckets.size(); }
+ size_t count() const { return buckets.size(); }
};
public:
RGWObject() : key() {}
- RGWObject(const rgw_obj_key &_k) : key(_k) {}
+ RGWObject(const rgw_obj_key& _k) : key(_k) {}
virtual ~RGWObject() = default;
- virtual int read(off_t offset, off_t length, std::iostream &stream) = 0;
- virtual int write(off_t offset, off_t length, std::iostream &stream) = 0;
+ virtual int read(off_t offset, off_t length, std::iostream& stream) = 0;
+ virtual int write(off_t offset, off_t length, std::iostream& stream) = 0;
virtual RGWAttrs& get_attrs(void) = 0;
- virtual int set_attrs(RGWAttrs &attrs) = 0;
+ virtual int set_attrs(RGWAttrs& attrs) = 0;
virtual int delete_object(void) = 0;
virtual RGWAccessControlPolicy& get_acl(void) = 0;
- virtual int set_acl(const RGWAccessControlPolicy &acl) = 0;
+ virtual int set_acl(const RGWAccessControlPolicy& acl) = 0;
};
RGWRadosStore *store;
public:
- RGWRadosUser(RGWRadosStore *_st, const rgw_user &_u) : RGWUser(_u), store(_st) { }
+ RGWRadosUser(RGWRadosStore *_st, const rgw_user& _u) : RGWUser(_u), store(_st) { }
+ RGWRadosUser(RGWRadosStore *_st, const RGWUserInfo& _i) : RGWUser(_i), store(_st) { }
RGWRadosUser() {}
int list_buckets(const string& marker, const string& end_marker,
- uint64_t max, bool need_stats, RGWBucketList &buckets);
- RGWSalBucket* add_bucket(rgw_bucket& bucket, ceph::real_time creation_time);
+ uint64_t max, bool need_stats, RGWBucketList& buckets);
+ RGWBucket* add_bucket(rgw_bucket& bucket, ceph::real_time creation_time);
+ virtual std::string& get_display_name() override;
friend class RGWRadosBucket;
};
acls() {
}
- RGWRadosObject(RGWRadosStore *_st, const rgw_obj_key &_k)
+ RGWRadosObject(RGWRadosStore *_st, const rgw_obj_key& _k)
: RGWObject(_k),
store(_st),
attrs(),
acls() {
}
- int read(off_t offset, off_t length, std::iostream &stream) { return length; }
- int write(off_t offset, off_t length, std::iostream &stream) { return length; }
+ int read(off_t offset, off_t length, std::iostream& stream) { return length; }
+ int write(off_t offset, off_t length, std::iostream& stream) { return length; }
RGWAttrs& get_attrs(void) { return attrs; }
- int set_attrs(RGWAttrs &a) { attrs = a; return 0; }
+ int set_attrs(RGWAttrs& a) { attrs = a; return 0; }
int delete_object(void) { return 0; }
RGWAccessControlPolicy& get_acl(void) { return acls; }
- int set_acl(const RGWAccessControlPolicy &acl) { acls = acl; return 0; }
+ int set_acl(const RGWAccessControlPolicy& acl) { acls = acl; return 0; }
};
-class RGWRadosBucket : public RGWSalBucket {
+class RGWRadosBucket : public RGWBucket {
private:
RGWRadosStore *store;
RGWRadosObject *object;
- RGWAttrs attrs;
RGWAccessControlPolicy acls;
RGWRadosUser user;
RGWRadosBucket()
: store(nullptr),
object(nullptr),
- attrs(),
acls(),
user() {
}
- RGWRadosBucket(RGWRadosStore *_st, RGWUser &_u, const rgw_bucket &_b)
- : RGWSalBucket(_b),
+ RGWRadosBucket(RGWRadosStore *_st, RGWUser& _u, const rgw_bucket& _b)
+ : RGWBucket(_b),
store(_st),
object(nullptr),
- attrs(),
acls(),
user(dynamic_cast<RGWRadosUser&>(_u)) {
}
- RGWRadosBucket(RGWRadosStore *_st, RGWUser &_u, const RGWBucketEnt &_e)
- : RGWSalBucket(_e),
+ RGWRadosBucket(RGWRadosStore *_st, RGWUser& _u, const RGWBucketEnt& _e)
+ : RGWBucket(_e),
store(_st),
object(nullptr),
- attrs(),
acls(),
user(dynamic_cast<RGWRadosUser&>(_u)) {
}
~RGWRadosBucket() { }
- RGWObject* get_object(const rgw_obj_key &key) { return object; }
+ RGWObject* get_object(const rgw_obj_key& key) { return object; }
RGWBucketList* list(void) { return new RGWBucketList(); }
- RGWObject* create_object(const rgw_obj_key &key /* Attributes */) override;
- RGWAttrs& get_attrs(void) { return attrs; }
- int set_attrs(RGWAttrs &a) { attrs = a; return 0; }
+ RGWObject* create_object(const rgw_obj_key& key /* Attributes */) override;
virtual int remove_bucket(bool delete_children, optional_yield y) override;
RGWAccessControlPolicy& get_acl(void) { return acls; }
- virtual int set_acl(RGWAccessControlPolicy &acl, RGWBucketInfo& bucket_info, optional_yield y) override;
- virtual int get_bucket_info(RGWBucketInfo &info, optional_yield y) override;
+ virtual int set_acl(RGWAccessControlPolicy& acl, optional_yield y) override;
+ virtual int get_bucket_info(optional_yield y) override;
virtual int get_bucket_stats(RGWBucketInfo& bucket_info, int shard_id,
std::string *bucket_ver, std::string *master_ver,
std::map<RGWObjCategory, RGWStorageStats>& stats,
std::string *max_marker = nullptr,
bool *syncstopped = nullptr) override;
- virtual int sync_user_stats(RGWBucketInfo &info) override;
+ virtual int read_bucket_stats(optional_yield y) override;
+ virtual int sync_user_stats() override;
virtual int update_container_stats(void) override;
+ virtual int check_bucket_shards(void) override;
+ virtual int link(RGWUser* new_user, optional_yield y) override;
+ virtual int unlink(RGWUser* new_user, optional_yield y) override;
+ virtual int chown(RGWUser* new_user, RGWUser* old_user, optional_yield y) override;
+ virtual bool is_owner(RGWUser *user) override;
};
class RGWRadosStore : public RGWStore {
private:
RGWRados *rados;
- RGWRadosBucket *bucket;
RGWUserCtl *user_ctl;
public:
RGWRadosStore()
- : rados(nullptr),
- bucket(nullptr) {
+ : rados(nullptr) {
}
~RGWRadosStore() {
- delete bucket;
delete rados;
}
- virtual RGWUser* get_user(const rgw_user &u);
- virtual RGWSalBucket* get_bucket(RGWUser &u, const rgw_bucket &b) { return bucket; }
- //virtual RGWSalBucket* create_bucket(RGWUser &u, const rgw_bucket &b);
+ virtual RGWUser* get_user(const rgw_user& u);
+ virtual int get_bucket(RGWUser& u, const rgw_bucket& b, RGWBucket** bucket) override;
+ //virtual RGWBucket* create_bucket(RGWUser& u, const rgw_bucket& b);
virtual RGWBucketList* list_buckets(void) { return new RGWBucketList(); }
void setRados(RGWRados * st) { rados = st; }
ldout(cct, 0) << "failed to read user buckets: ret=" << ret << dendl;
return ret;
}
- map<string, rgw::sal::RGWSalBucket*>& buckets = user_buckets.get_buckets();
- for (map<string, rgw::sal::RGWSalBucket*>::iterator i = buckets.begin();
+ map<string, rgw::sal::RGWBucket*>& buckets = user_buckets.get_buckets();
+ for (map<string, rgw::sal::RGWBucket*>::iterator i = buckets.begin();
i != buckets.end();
++i) {
marker = i->first;
- rgw::sal::RGWSalBucket* bucket = i->second;
- RGWBucketInfo bucket_info;
+ rgw::sal::RGWBucket* bucket = i->second;
- ret = bucket->get_bucket_info(bucket_info, null_yield);
+ ret = bucket->get_bucket_info(null_yield);
if (ret < 0) {
ldout(cct, 0) << "ERROR: could not read bucket info: bucket=" << bucket << " ret=" << ret << dendl;
continue;
}
- ret = bucket->sync_user_stats(bucket_info);
+ ret = bucket->sync_user_stats();
if (ret < 0) {
ldout(cct, 0) << "ERROR: could not sync bucket stats: ret=" << ret << dendl;
return ret;
}
- ret = store->getRados()->check_bucket_shards(bucket_info, bucket_info.bucket, bucket->get_count());
+ ret = bucket->check_bucket_shards();
if (ret < 0) {
ldout(cct, 0) << "ERROR in check_bucket_shards: " << cpp_strerror(-ret)<< dendl;
}
ldout(cct, 0) << "failed to read user buckets: ret=" << ret << dendl;
return ret;
}
- std::map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
+ std::map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
for (const auto& i : m) {
marker = i.first;
- rgw::sal::RGWSalBucket* bucket_ent = i.second;
- RGWBucketEnt stats;
- ret = store->ctl()->bucket->read_bucket_stats(bucket_ent->get_bi(), &stats, null_yield);
+ rgw::sal::RGWBucket* bucket_ent = i.second;
+ ret = bucket_ent->read_bucket_stats(null_yield);
if (ret < 0) {
ldout(cct, 0) << "ERROR: could not get bucket stats: ret=" << ret << dendl;
return ret;
}
cls_user_bucket_entry entry;
- stats.convert(&entry);
+ bucket_ent->convert(&entry);
buckets_usage_map.emplace(bucket_ent->get_name(), entry);
}
done = (buckets.count() < max_entries);
}
}
- rgw::sal::RGWUser* old_user = new rgw::sal::RGWRadosUser(store, op_state.get_user_id());
- RGWUserInfo old_user_info = op_state.get_user_info();
- rgw::sal::RGWUser* new_user = new rgw::sal::RGWRadosUser(store, op_state.get_new_uid());
- if (old_user->get_tenant() != new_user->get_tenant()) {
+ rgw::sal::RGWRadosUser old_user(store, op_state.get_user_info());
+ rgw::sal::RGWRadosUser new_user(store, op_state.get_new_uid());
+ if (old_user.get_tenant() != new_user.get_tenant()) {
set_err_msg(err_msg, "users have to be under the same tenant namespace "
- + old_user->get_tenant() + " != " + new_user->get_tenant());
+ + old_user.get_tenant() + " != " + new_user.get_tenant());
return -EINVAL;
}
// create a stub user and write only the uid index and buckets object
RGWUserInfo stub_user_info;
- stub_user_info.user_id = new_user->get_user();
+ stub_user_info.user_id = new_user.get_user();
RGWObjVersionTracker objv;
const bool exclusive = !op_state.get_overwrite_new_user(); // overwrite if requested
}
RGWAccessControlPolicy policy_instance;
- policy_instance.create_default(new_user->get_user(), old_user_info.display_name);
+ policy_instance.create_default(new_user.get_user(), old_user.get_display_name());
//unlink and link buckets to new user
string marker;
- string obj_marker;
CephContext *cct = store->ctx();
size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
- RGWBucketCtl* bucket_ctl = store->ctl()->bucket;
rgw::sal::RGWBucketList buckets;
do {
- ret = old_user->list_buckets(marker, "", max_buckets, false, buckets);
+ ret = old_user.list_buckets(marker, "", max_buckets, false, buckets);
if (ret < 0) {
set_err_msg(err_msg, "unable to list user buckets");
return ret;
}
- map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
- std::map<std::string, rgw::sal::RGWSalBucket*>::iterator it;
+ map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
+ std::map<std::string, rgw::sal::RGWBucket*>::iterator it;
for (it = m.begin(); it != m.end(); ++it) {
- rgw::sal::RGWSalBucket* bucket = it->second;
+ rgw::sal::RGWBucket* bucket = it->second;
marker = it->first;
- RGWBucketInfo bucket_info;
- ret = bucket->get_bucket_info(bucket_info, null_yield);
+ ret = bucket->get_bucket_info(null_yield);
if (ret < 0) {
set_err_msg(err_msg, "failed to fetch bucket info for bucket=" + bucket->get_name());
return ret;
}
- ret = bucket->set_acl(policy_instance, bucket_info, null_yield);
+ ret = bucket->set_acl(policy_instance, null_yield);
if (ret < 0) {
set_err_msg(err_msg, "failed to set acl on bucket " + bucket->get_name());
return ret;
}
- RGWBucketEntryPoint ep;
- ep.bucket = bucket_info.bucket;
- ep.owner = new_user->get_user();
- ep.creation_time = bucket_info.creation_time;
- ep.linked = true;
- map<string, bufferlist> ep_attrs;
- rgw_ep_info ep_data{ep, ep_attrs};
-
- ret = bucket_ctl->link_bucket(new_user->get_user(), bucket_info.bucket,
- ceph::real_time(), null_yield, true, &ep_data);
+ ret = bucket->link(&new_user, null_yield);
if (ret < 0) {
set_err_msg(err_msg, "failed to link bucket " + bucket->get_name());
return ret;
}
- ret = bucket_ctl->chown(store, bucket_info, new_user->get_user(),
- old_user_info.display_name, obj_marker, null_yield);
+ ret = bucket->chown(&new_user, &old_user, null_yield);
if (ret < 0) {
set_err_msg(err_msg, "failed to run bucket chown" + cpp_strerror(-ret));
return ret;
// update the 'stub user' with all of the other fields and rewrite all of the
// associated index objects
RGWUserInfo& user_info = op_state.get_user_info();
- user_info.user_id = new_user->get_user();
+ user_info.user_id = new_user.get_user();
op_state.objv = objv;
- rename_swift_keys(new_user->get_user(), user_info.swift_keys);
+ rename_swift_keys(new_user.get_user(), user_info.swift_keys);
return update(op_state, err_msg);
}
return ret;
}
- std::map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
+ std::map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
if (!m.empty() && !purge_data) {
set_err_msg(err_msg, "must specify purge data to remove user with buckets");
return -EEXIST; // change to code that maps to 409: conflict
}
- std::map<std::string, rgw::sal::RGWSalBucket*>::iterator it;
+ std::map<std::string, rgw::sal::RGWBucket*>::iterator it;
for (it = m.begin(); it != m.end(); ++it) {
ret = it->second->remove_bucket(true, y);
if (ret < 0) {
return ret;
}
- std::map<std::string, rgw::sal::RGWSalBucket*>& m = buckets.get_buckets();
- std::map<std::string, rgw::sal::RGWSalBucket*>::iterator iter;
+ std::map<std::string, rgw::sal::RGWBucket*>& m = buckets.get_buckets();
+ std::map<std::string, rgw::sal::RGWBucket*>::iterator iter;
vector<rgw_bucket> bucket_names;
for (iter = m.begin(); iter != m.end(); ++iter) {
- rgw::sal::RGWSalBucket* obj = iter->second;
+ rgw::sal::RGWBucket* obj = iter->second;
bucket_names.push_back(obj->get_bi());
marker = iter->first;