map<string, bool> common_prefixes;
string ns;
- RGWRados::Bucket target(store, bucket);
+ RGWRados::Bucket target(store, bucket_info);
RGWRados::Bucket::List list_op(&target);
string marker;
map<string, bool> common_prefixes;
string ns;
- RGWRados::Bucket target(store, bucket);
+ RGWRados::Bucket target(store, bucket_info);
RGWRados::Bucket::List list_op(&target);
list_op.params.prefix = prefix;
return ret;
- RGWRados::Bucket target(store, bucket);
+ RGWRados::Bucket target(store, info);
RGWRados::Bucket::List list_op(&target);
list_op.params.list_versions = true;
map<string, bool> meta_objs;
map<rgw_obj_key, string> all_objs;
- RGWRados::Bucket target(store, bucket);
+ RGWBucketInfo bucket_info;
+ RGWObjectCtx obj_ctx(store);
+ int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, nullptr, nullptr);
+ if (r < 0) {
+ ldout(store->ctx(), 0) << "ERROR: " << __func__ << "(): get_bucket_instance_info(bucket=" << bucket << ") returned r=" << r << dendl;
+ return r;
+ }
+
+ RGWRados::Bucket target(store, bucket_info);
RGWRados::Bucket::List list_op(&target);
list_op.params.list_versions = true;
RGWRados * const store,
const off_t ofs,
const off_t end,
- rgw_bucket& bucket,
+ RGWBucketInfo *pbucket_info,
const string& obj_prefix,
RGWAccessControlPolicy * const bucket_policy,
uint64_t * const ptotal_len,
void *param),
void * const cb_param)
{
+ rgw_bucket& bucket = pbucket_info->bucket;
uint64_t obj_ofs = 0, len_count = 0;
bool found_start = false, found_end = false, handled_end = false;
string delim;
utime_t start_time = ceph_clock_now(cct);
- RGWRados::Bucket target(store, bucket);
+ RGWRados::Bucket target(store, *pbucket_info);
RGWRados::Bucket::List list_op(&target);
list_op.params.prefix = obj_prefix;
RGWAccessControlPolicy _bucket_policy(s->cct);
RGWAccessControlPolicy *bucket_policy;
+ RGWBucketInfo bucket_info;
+ RGWBucketInfo *pbucket_info;
if (bucket_name.compare(s->bucket.name) != 0) {
- RGWBucketInfo bucket_info;
map<string, bufferlist> bucket_attrs;
RGWObjectCtx obj_ctx(store);
int r = store->get_bucket_info(obj_ctx, s->user->user_id.tenant,
return r;
}
bucket = bucket_info.bucket;
+ pbucket_info = &bucket_info;
rgw_obj_key no_obj;
bucket_policy = &_bucket_policy;
r = read_policy(store, s, bucket_info, bucket_attrs, bucket_policy, bucket, no_obj);
}
} else {
bucket = s->bucket;
+ pbucket_info = &s->bucket_info;
bucket_policy = s->bucket_acl;
}
* - overall DLO's content size,
* - md5 sum of overall DLO's content (for etag of Swift API). */
int r = iterate_user_manifest_parts(s->cct, store, ofs, end,
- bucket, obj_prefix, bucket_policy,
+ pbucket_info, obj_prefix, bucket_policy,
&total_len, &s->obj_size, &lo_etag,
nullptr /* cb */, nullptr /* cb arg */);
if (r < 0) {
}
r = iterate_user_manifest_parts(s->cct, store, ofs, end,
- bucket, obj_prefix, bucket_policy,
+ pbucket_info, obj_prefix, bucket_policy,
nullptr, nullptr, nullptr,
get_obj_user_manifest_iterate_cb, (void *)this);
if (r < 0) {
}
}
- RGWRados::Bucket target(store, s->bucket);
+ RGWRados::Bucket target(store, s->bucket_info);
if (shard_id >= 0) {
target.set_shard_id(shard_id);
}
}
marker_meta = marker.get_meta();
- RGWRados::Bucket target(store, s->bucket);
+ RGWRados::Bucket target(store, s->bucket_info);
RGWRados::Bucket::List list_op(&target);
list_op.params.prefix = prefix;
return ret;
}
- RGWRados::Bucket target(store, bucket_info.bucket);
+ RGWRados::Bucket target(store, bucket_info);
RGWRados::Bucket::List list_op(&target);
string marker;
return 0;
}
+
/**
* get listing of the objects in a bucket.
* bucket: bucket to list contents of
bool versioned_op = (target->versioning_enabled() || is_olh || versioned_target);
- RGWRados::Bucket bop(store, bucket);
+ RGWRados::Bucket bop(store, target->get_bucket_info());
RGWRados::Bucket::UpdateIndex index_op(&bop, obj, state);
if (versioned_op) {
bool ret_not_existed = (!state->exists);
- RGWRados::Bucket bop(store, bucket);
+ RGWRados::Bucket bop(store, target->get_bucket_info());
RGWRados::Bucket::UpdateIndex index_op(&bop, obj, state);
index_op.set_bilog_flags(params.bilog_flags);
std::string oid, key;
get_obj_bucket_and_oid_loc(obj, bucket, oid, key);
- RGWRados::Bucket bop(this, bucket);
+ RGWObjectCtx obj_ctx(this);
+
+ RGWBucketInfo bucket_info;
+ int ret = get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL);
+ if (ret < 0) {
+ ldout(cct, 0) << "ERROR: " << __func__ << "() get_bucket_instance_info(bucket=" << bucket << ") returned ret=" << ret << dendl;
+ return ret;
+ }
+
+ RGWRados::Bucket bop(this, bucket_info);
RGWRados::Bucket::UpdateIndex index_op(&bop, obj, NULL);
int r = index_op.complete_del(-1 /* pool */, 0, NULL);
if (!op.size())
return 0;
+ RGWObjectCtx obj_ctx(this);
+
+ RGWBucketInfo bucket_info;
+ int ret = get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL);
+ if (ret < 0) {
+ ldout(cct, 0) << "ERROR: " << __func__ << "() get_bucket_instance_info(bucket=" << bucket << ") returned ret=" << ret << dendl;
+ return ret;
+ }
+
bufferlist bl;
- RGWRados::Bucket bop(this, bucket);
+ RGWRados::Bucket bop(this, bucket_info);
RGWRados::Bucket::UpdateIndex index_op(&bop, obj, state);
if (state) {
int RGWRados::Bucket::UpdateIndex::prepare(RGWModifyOp op)
{
+ if (blind) {
+ return 0;
+ }
RGWRados *store = target->get_store();
BucketShard *bs;
int ret = get_bucket_shard(&bs);
utime_t& ut, string& etag, string& content_type, bufferlist *acl_bl, RGWObjCategory category,
list<rgw_obj_key> *remove_objs)
{
+ if (blind) {
+ return 0;
+ }
RGWRados *store = target->get_store();
BucketShard *bs;
int ret = get_bucket_shard(&bs);
int RGWRados::Bucket::UpdateIndex::complete_del(int64_t poolid, uint64_t epoch,
list<rgw_obj_key> *remove_objs)
{
+ if (blind) {
+ return 0;
+ }
RGWRados *store = target->get_store();
BucketShard *bs;
int ret = get_bucket_shard(&bs);
int RGWRados::Bucket::UpdateIndex::cancel()
{
+ if (blind) {
+ return 0;
+ }
RGWRados *store = target->get_store();
BucketShard *bs;
int ret = get_bucket_shard(&bs);
class Bucket {
RGWRados *store;
+ RGWBucketInfo bucket_info;
rgw_bucket& bucket;
int shard_id;
public:
- Bucket(RGWRados *_store, rgw_bucket& _bucket) : store(_store), bucket(_bucket), shard_id(RGW_NO_SHARD) {}
-
+ Bucket(RGWRados *_store, RGWBucketInfo& _bucket_info) : store(_store), bucket_info(_bucket_info), bucket(bucket_info.bucket),
+ shard_id(RGW_NO_SHARD) {}
RGWRados *get_store() { return store; }
rgw_bucket& get_bucket() { return bucket; }
+ RGWBucketInfo& get_bucket_info() { return bucket_info; }
int get_shard_id() { return shard_id; }
void set_shard_id(int id) {
uint16_t bilog_flags;
BucketShard bs;
bool bs_initialized;
+ bool blind;
public:
UpdateIndex(RGWRados::Bucket *_target, rgw_obj& _obj, RGWObjState *_state) : target(_target), obj(_obj), obj_state(_state), bilog_flags(0),
- bs(target->get_store()), bs_initialized(false) {}
+ bs(target->get_store()), bs_initialized(false) {
+ blind = (target->get_bucket_info().index_type == RGWBIType_Indexless);
+ }
int get_bucket_shard(BucketShard **pbs) {
if (!bs_initialized) {