return rgw_obj::translate_raw_obj_to_obj_in_ns(obj, instance, ns);
}
-int check_min_obj_stripe_size(RGWRados *store, rgw_obj& obj, uint64_t min_stripe_size, bool *need_rewrite)
+int check_min_obj_stripe_size(RGWRados *store, RGWBucketInfo& bucket_info, rgw_obj& obj, uint64_t min_stripe_size, bool *need_rewrite)
{
map<string, bufferlist> attrs;
uint64_t obj_size;
RGWObjectCtx obj_ctx(store);
- RGWRados::Object op_target(store, obj_ctx, obj);
+ RGWRados::Object op_target(store, bucket_info, obj_ctx, obj);
RGWRados::Object::Read read_op(&op_target);
read_op.params.attrs = &attrs;
return -ret;
}
rgw_obj_key key(object, object_version);
- ret = rgw_remove_object(store, bucket_info.owner, bucket, key, bucket_info.versioning_enabled());
+ ret = rgw_remove_object(store, bucket_info, bucket, key, bucket_info.versioning_enabled());
if (ret < 0) {
cerr << "ERROR: object remove returned: " << cpp_strerror(-ret) << std::endl;
obj.set_instance(object_version);
bool need_rewrite = true;
if (min_rewrite_stripe_size > 0) {
- ret = check_min_obj_stripe_size(store, obj, min_rewrite_stripe_size, &need_rewrite);
+ ret = check_min_obj_stripe_size(store, bucket_info, obj, min_rewrite_stripe_size, &need_rewrite);
if (ret < 0) {
ldout(store->ctx(), 0) << "WARNING: check_min_obj_stripe_size failed, r=" << ret << dendl;
}
bool need_rewrite = true;
if (min_rewrite_stripe_size > 0) {
- r = check_min_obj_stripe_size(store, obj, min_rewrite_stripe_size, &need_rewrite);
+ r = check_min_obj_stripe_size(store, bucket_info, obj, min_rewrite_stripe_size, &need_rewrite);
if (r < 0) {
ldout(store->ctx(), 0) << "WARNING: check_min_obj_stripe_size failed, r=" << r << dendl;
}
uint64_t obj_size;
map<string, bufferlist> attrs;
RGWObjectCtx obj_ctx(store);
- RGWRados::Object op_target(store, obj_ctx, obj);
+ RGWRados::Object op_target(store, bucket_info, obj_ctx, obj);
RGWRados::Object::Read read_op(&op_target);
read_op.params.attrs = &attrs;
return rgw_obj::translate_raw_obj_to_obj_in_ns(obj, ns, ver);
}
-int rgw_remove_object(RGWRados *store, const string& bucket_owner, rgw_bucket& bucket, rgw_obj_key& key, bool use_versioning)
+int rgw_remove_object(RGWRados *store, RGWBucketInfo& bucket_info, rgw_bucket& bucket, rgw_obj_key& key, bool use_versioning)
{
RGWObjectCtx rctx(store);
rgw_obj obj(bucket, key);
- int ret = store->delete_obj(rctx, bucket_owner, obj, use_versioning);
+ int ret = store->delete_obj(rctx, bucket_info, obj, use_versioning);
return ret;
}
while (!objs.empty()) {
std::vector<RGWObjEnt>::iterator it = objs.begin();
for (it = objs.begin(); it != objs.end(); ++it) {
- ret = rgw_remove_object(store, bucket_owner, bucket, (*it).key, false);
+ ret = rgw_remove_object(store, info, bucket, (*it).key, false);
if (ret < 0)
return ret;
}
rgw_obj_key key(object_name);
- int ret = rgw_remove_object(store, bucket_info.owner, bucket, key, bucket_info.versioning_enabled());
+ int ret = rgw_remove_object(store, bucket_info, bucket, key, bucket_info.versioning_enabled());
if (ret < 0) {
set_err_msg(err_msg, "unable to remove object" + cpp_strerror(-ret));
return ret;
rgw_bucket bucket = op_state.get_bucket();
RGWObjectCtx obj_ctx(store);
+ RGWBucketInfo bucket_info;
+ map<string, bufferlist> attrs;
+ int ret = store->get_bucket_info(obj_ctx, bucket.name, bucket_info, NULL, &attrs);
+ if (ret < 0) {
+ return ret;
+ }
+
if (!object_name.empty()) {
bufferlist bl;
rgw_obj obj(bucket, object_name);
- RGWRados::Object op_target(store, obj_ctx, obj);
+ RGWRados::Object op_target(store, bucket_info, obj_ctx, obj);
RGWRados::Object::Read rop(&op_target);
int ret = rop.get_attr(RGW_ATTR_ACL, bl);
return policy_bl_to_stream(bl, o);
}
-
- RGWBucketInfo bucket_info;
- map<string, bufferlist> attrs;
- int ret = store->get_bucket_info(obj_ctx, bucket.name, bucket_info, NULL, &attrs);
- if (ret < 0) {
- return ret;
- }
-
map<string, bufferlist>::iterator aiter = attrs.find(RGW_ATTR_ACL);
if (aiter == attrs.end()) {
return -ENOENT;
extern int rgw_link_bucket(RGWRados *store, string user_id, rgw_bucket& bucket, time_t creation_time, bool update_entrypoint = true);
extern int rgw_unlink_bucket(RGWRados *store, string user_id, const string& bucket_name, bool update_entrypoint = true);
-extern int rgw_remove_object(RGWRados *store, const string& bucket_owner, rgw_bucket& bucket, rgw_obj_key& key, bool use_versioning);
+extern int rgw_remove_object(RGWRados *store, RGWBucketInfo& bucket_info, rgw_bucket& bucket, rgw_obj_key& key, bool use_versioning);
extern int rgw_remove_bucket(RGWRados *store, const string& bucket_owner, rgw_bucket& bucket, bool delete_children);
extern int rgw_bucket_set_attrs(RGWRados *store, RGWBucketInfo& bucket_info,
bufferlist bl;
int ret = 0;
- RGWRados::Object op_target(store, obj_ctx, obj);
+ RGWRados::Object op_target(store, bucket_info, obj_ctx, obj);
RGWRados::Object::Read rop(&op_target);
ret = rop.get_attr(RGW_ATTR_ACL, bl);
static int get_obj_attrs(RGWRados *store, struct req_state *s, rgw_obj& obj, map<string, bufferlist>& attrs)
{
- RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, obj);
+ RGWRados::Object op_target(store, s->bucket_info, *(RGWObjectCtx *)s->obj_ctx, obj);
RGWRados::Object::Read read_op(&op_target);
read_op.params.attrs = &attrs;
obj_ctx.set_atomic(part);
store->set_prefetch_data(&obj_ctx, part);
- RGWRados::Object op_target(store, obj_ctx, part);
+ RGWRados::Object op_target(store, s->bucket_info, obj_ctx, part);
RGWRados::Object::Read read_op(&op_target);
read_op.params.attrs = &attrs;
perfcounter->inc(l_rgw_get);
int64_t new_ofs, new_end;
- RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, obj);
+ RGWRados::Object op_target(store, s->bucket_info, *(RGWObjectCtx *)s->obj_ctx, obj);
RGWRados::Object::Read read_op(&op_target);
ret = get_params();
public:
bool immutable_head() { return true; }
- RGWPutObjProcessor_Multipart(RGWObjectCtx& obj_ctx, const string& bucket_owner, uint64_t _p, req_state *_s) :
- RGWPutObjProcessor_Atomic(obj_ctx, bucket_owner, _s->bucket, _s->object.name, _p, _s->req_id, false), s(_s) {}
+ RGWPutObjProcessor_Multipart(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, uint64_t _p, req_state *_s) :
+ RGWPutObjProcessor_Atomic(obj_ctx, bucket_info, _s->bucket, _s->object.name, _p, _s->req_id, false), s(_s) {}
};
int RGWPutObjProcessor_Multipart::prepare(RGWRados *store, string *oid_rand)
{
complete_writing_data();
- RGWRados::Object op_target(store, obj_ctx, head_obj);
+ RGWRados::Object op_target(store, s->bucket_info, obj_ctx, head_obj);
RGWRados::Object::Write head_obj_op(&op_target);
head_obj_op.meta.set_mtime = set_mtime;
uint64_t part_size = s->cct->_conf->rgw_obj_stripe_size;
- const string& bucket_owner = s->bucket_owner.get_id();
-
if (!multipart) {
- processor = new RGWPutObjProcessor_Atomic(obj_ctx, bucket_owner, s->bucket, s->object.name, part_size, s->req_id, s->bucket_info.versioning_enabled());
+ processor = new RGWPutObjProcessor_Atomic(obj_ctx, s->bucket_info, s->bucket, s->object.name, part_size, s->req_id, s->bucket_info.versioning_enabled());
((RGWPutObjProcessor_Atomic *)processor)->set_olh_epoch(olh_epoch);
((RGWPutObjProcessor_Atomic *)processor)->set_version_id(version_id);
} else {
- processor = new RGWPutObjProcessor_Multipart(obj_ctx, bucket_owner, part_size, s);
+ processor = new RGWPutObjProcessor_Multipart(obj_ctx, s->bucket_info, part_size, s);
}
if (is_multipart) {
uint64_t part_size = s->cct->_conf->rgw_obj_stripe_size;
- processor = new RGWPutObjProcessor_Atomic(obj_ctx, s->bucket_owner.get_id(), s->bucket, s->object.name, part_size, s->req_id, s->bucket_info.versioning_enabled());
+ processor = new RGWPutObjProcessor_Atomic(obj_ctx, s->bucket_info, s->bucket, s->object.name, part_size, s->req_id, s->bucket_info.versioning_enabled());
return processor;
}
obj_ctx->set_atomic(obj);
- RGWRados::Object del_target(store, *obj_ctx, obj);
+ RGWRados::Object del_target(store, s->bucket_info, *obj_ctx, obj);
RGWRados::Object::Delete del_op(&del_target);
ret = get_system_versioning_params(s, &del_op.params.olh_epoch, &del_op.params.marker_version_id);
// the meta object will be indexed with 0 size, we c
obj.set_in_extra_data(true);
- RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, obj);
+ RGWRados::Object op_target(store, s->bucket_info, *(RGWObjectCtx *)s->obj_ctx, obj);
RGWRados::Object::Write obj_op(&op_target);
obj_op.meta.owner = s->owner.get_id();
obj_ctx.set_atomic(target_obj);
- RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, target_obj);
+ RGWRados::Object op_target(store, s->bucket_info, *(RGWObjectCtx *)s->obj_ctx, target_obj);
RGWRados::Object::Write obj_op(&op_target);
obj_op.meta.manifest = &manifest;
if (ret < 0)
return;
- if (versioned_object) {
- ret = store->set_olh(obj_ctx, s->bucket_owner.get_id(), target_obj, false, NULL, olh_epoch);
- if (ret < 0) {
- return;
- }
- }
-
// remove the upload obj
- int r = store->delete_obj(*(RGWObjectCtx *)s->obj_ctx, s->bucket_owner.get_id(), meta_obj, 0);
+ int r = store->delete_obj(*(RGWObjectCtx *)s->obj_ctx, s->bucket_info, meta_obj, 0);
if (r < 0) {
ldout(store->ctx(), 0) << "WARNING: failed to remove object " << meta_obj << dendl;
}
map<string, bufferlist> attrs;
rgw_obj meta_obj;
RGWMPObj mp;
- const string& owner = s->bucket_owner.get_id();
if (upload_id.empty() || s->object.empty())
return;
string oid = mp.get_part(obj_iter->second.num);
rgw_obj obj;
obj.init_ns(s->bucket, oid, mp_ns);
- ret = store->delete_obj(*obj_ctx, owner, obj, 0);
+ ret = store->delete_obj(*obj_ctx, s->bucket_info, obj, 0);
if (ret < 0 && ret != -ENOENT)
return;
} else {
RGWObjManifest::obj_iterator oiter;
for (oiter = manifest.obj_begin(); oiter != manifest.obj_end(); ++oiter) {
rgw_obj loc = oiter.get_location();
- ret = store->delete_obj(*obj_ctx, owner, loc, 0);
+ ret = store->delete_obj(*obj_ctx, s->bucket_info, loc, 0);
if (ret < 0 && ret != -ENOENT)
return;
}
// and also remove the metadata obj
meta_obj.init_ns(s->bucket, meta_oid, mp_ns);
meta_obj.set_in_extra_data(true);
- ret = store->delete_obj(*obj_ctx, owner, meta_obj, 0);
+ ret = store->delete_obj(*obj_ctx, s->bucket_info, meta_obj, 0);
if (ret == -ENOENT) {
ret = -ERR_NO_SUCH_BUCKET;
}
rgw_obj obj(bucket,(*iter));
obj_ctx->set_atomic(obj);
- ret = store->delete_obj(*obj_ctx, s->bucket_owner.get_id(), obj, s->bucket_info.versioning_status());
+ ret = store->delete_obj(*obj_ctx, s->bucket_info, obj, s->bucket_info.versioning_status());
if (ret == -ENOENT) {
ret = 0;
}
list<rgw_obj>::iterator iter;
for (iter = written_objs.begin(); iter != written_objs.end(); ++iter) {
rgw_obj& obj = *iter;
- int r = store->delete_obj(obj_ctx, bucket_owner, obj, false);
+ int r = store->delete_obj(obj_ctx, bucket_info, obj, false);
if (r < 0 && r != -ENOENT) {
ldout(store->ctx(), 0) << "WARNING: failed to remove obj (" << obj << "), leaked" << dendl;
}
obj_ctx.set_atomic(head_obj);
- RGWRados::Object op_target(store, obj_ctx, head_obj);
+ RGWRados::Object op_target(store, bucket_info, obj_ctx, head_obj);
+
+ /* some object types shouldn't be versioned, e.g., multipart parts */
+ op_target.set_versioning_disabled(!versioned_object);
+
RGWRados::Object::Write obj_op(&op_target);
obj_op.meta.data = &first_chunk;
obj_op.meta.if_nomatch = if_nomatch;
obj_op.meta.mtime = mtime;
obj_op.meta.set_mtime = set_mtime;
- obj_op.meta.owner = bucket_owner;
+ obj_op.meta.owner = bucket_info.owner;
obj_op.meta.flags = PUT_OBJ_CREATE;
obj_op.meta.olh_epoch = olh_epoch;
- bool is_olh = false;
- if (head_obj.get_instance().empty()) {
- RGWObjState *astate = NULL;
- r = store->get_obj_state(&obj_ctx, head_obj, &astate, NULL, false); /* don't follow olh */
- if (r < 0) {
- return r;
- }
- is_olh = astate->is_olh;
- }
-
r = obj_op.write_meta(obj_len, attrs);
if (r < 0) {
return r;
}
- if (versioned_object || is_olh) {
- r = store->set_olh(obj_ctx, bucket_owner, head_obj, false, NULL, olh_epoch);
- if (r < 0) {
- return r;
- }
- }
return 0;
}
if (r < 0)
return r;
+ bool is_olh = state->is_olh;
+
bool reset_obj = (meta.flags & PUT_OBJ_CREATE) != 0;
r = target->prepare_atomic_modification(op, reset_obj, meta.ptag, meta.if_match, meta.if_nomatch);
if (r < 0)
*meta.mtime = meta.set_mtime;
}
+ if (target->versioning_enabled() || is_olh) {
+ r = store->set_olh(target->get_ctx(), target->get_bucket_info(), obj, false, NULL, meta.olh_epoch);
+ if (r < 0) {
+ return r;
+ }
+ }
+
/* update quota cache */
store->quota_handler->update_stats(meta.owner, bucket, (state->exists ? 0 : 1), size, state->size);
uint64_t obj_size;
RGWObjectCtx rctx(this);
- RGWRados::Object op_target(this, rctx, obj);
+ RGWRados::Object op_target(this, dest_bucket_info, rctx, obj);
RGWRados::Object::Read read_op(&op_target);
read_op.params.attrs = &attrset;
append_rand_alpha(cct, tag, tag, 32);
RGWPutObjProcessor_Atomic processor(obj_ctx,
- dest_bucket_info.owner, dest_obj.bucket, dest_obj.get_object(),
+ dest_bucket_info, dest_obj.bucket, dest_obj.get_object(),
cct->_conf->rgw_obj_stripe_size, tag, dest_bucket_info.versioning_enabled());
int ret = processor.prepare(this, NULL);
if (ret < 0)
map<string, bufferlist> src_attrs;
int64_t ofs = 0;
int64_t end = -1;
- RGWRados::Object src_op_target(this, obj_ctx, src_obj);
+ RGWRados::Object src_op_target(this, src_bucket_info, obj_ctx, src_obj);
RGWRados::Object::Read read_op(&src_op_target);
read_op.conds.mod_ptr = mod_ptr;
RGWObjManifest *pmanifest;
ldout(cct, 0) << "dest_obj=" << dest_obj << " src_obj=" << src_obj << " copy_itself=" << (int)copy_itself << dendl;
- RGWRados::Object dest_op_target(this, obj_ctx, dest_obj);
+ RGWRados::Object dest_op_target(this, dest_bucket_info, obj_ctx, dest_obj);
RGWRados::Object::Write write_op(&dest_op_target);
- RGWObjState *dest_state = NULL;
- ret = get_obj_state(&obj_ctx, dest_obj, &dest_state, NULL);
- if (ret < 0)
- return ret;
-
string tag;
if (ptag)
if (ret < 0)
goto done_ret;
- if (versioned_dest || dest_state->is_olh) {
- ret = set_olh(obj_ctx, dest_bucket_info.owner, dest_obj, false, NULL, olh_epoch);
- if (ret < 0) {
- goto done_ret;
- }
- }
-
return 0;
done_ret:
append_rand_alpha(cct, tag, tag, 32);
RGWPutObjProcessor_Atomic processor(obj_ctx,
- dest_bucket_info.owner, dest_obj.bucket, dest_obj.get_object(),
+ dest_bucket_info, dest_obj.bucket, dest_obj.get_object(),
cct->_conf->rgw_obj_stripe_size, tag, dest_bucket_info.versioning_enabled());
if (version_id) {
processor.set_version_id(*version_id);
meta.owner_display_name = params.obj_owner.get_display_name();
meta.mtime = ceph_clock_now(store->ctx());
- int r = store->set_olh(target->get_ctx(), params.bucket_owner, marker, true, &meta, params.olh_epoch);
+ int r = store->set_olh(target->get_ctx(), target->get_bucket_info(), marker, true, &meta, params.olh_epoch);
if (r < 0) {
return r;
}
if (exists) {
result.delete_marker = dirent.is_delete_marker();
}
- r = store->unlink_obj_instance(target->get_ctx(), params.bucket_owner, obj, params.olh_epoch);
+ r = store->unlink_obj_instance(target->get_ctx(), target->get_bucket_info(), obj, params.olh_epoch);
if (r < 0) {
return r;
}
return 0;
}
-int RGWRados::delete_obj(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& obj, int versioning_status)
+int RGWRados::delete_obj(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, rgw_obj& obj, int versioning_status)
{
- RGWRados::Object del_target(this, obj_ctx, obj);
+ RGWRados::Object del_target(this, bucket_info, obj_ctx, obj);
RGWRados::Object::Delete del_op(&del_target);
- del_op.params.bucket_owner = bucket_owner;
+ del_op.params.bucket_owner = bucket_info.owner;
del_op.params.versioning_status = versioning_status;
return del_op.delete_obj();
return 0;
}
-int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, RGWObjState& state, const string& bucket_owner, rgw_obj& obj,
+int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, RGWObjState& state, RGWBucketInfo& bucket_info, rgw_obj& obj,
bufferlist& olh_tag, map<uint64_t, vector<rgw_bucket_olh_log_entry> >& log,
uint64_t *plast_ver)
{
cls_rgw_obj_key& key = *liter;
rgw_obj obj_instance(bucket, key.name);
obj_instance.set_instance(key.instance);
- int ret = delete_obj(obj_ctx, bucket_owner, obj_instance, 0);
+ int ret = delete_obj(obj_ctx, bucket_info, obj_instance, 0);
if (ret < 0 && ret != -ENOENT) {
ldout(cct, 0) << "ERROR: delete_obj() returned " << ret << " obj_instance=" << obj_instance << dendl;
return ret;
/*
* read olh log and apply it
*/
-int RGWRados::update_olh(RGWObjectCtx& obj_ctx, RGWObjState *state, const string& bucket_owner, rgw_obj& obj)
+int RGWRados::update_olh(RGWObjectCtx& obj_ctx, RGWObjState *state, RGWBucketInfo& bucket_info, rgw_obj& obj)
{
map<uint64_t, vector<rgw_bucket_olh_log_entry> > log;
bool is_truncated;
if (ret < 0) {
return ret;
}
- ret = apply_olh_log(obj_ctx, *state, bucket_owner, obj, state->olh_tag, log, &ver_marker);
+ ret = apply_olh_log(obj_ctx, *state, bucket_info, obj, state->olh_tag, log, &ver_marker);
if (ret < 0) {
return ret;
}
return 0;
}
-int RGWRados::set_olh(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj, bool delete_marker, rgw_bucket_dir_entry_meta *meta,
+int RGWRados::set_olh(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, rgw_obj& target_obj, bool delete_marker, rgw_bucket_dir_entry_meta *meta,
uint64_t olh_epoch)
{
string op_tag;
continue;
}
- ret = update_olh(obj_ctx, state, bucket_owner, olh_obj);
+ ret = update_olh(obj_ctx, state, bucket_info, olh_obj);
if (ret < 0) {
ldout(cct, 20) << "update_olh() target_obj=" << target_obj << " returned " << ret << dendl;
continue;
return 0;
}
-int RGWRados::unlink_obj_instance(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj,
+int RGWRados::unlink_obj_instance(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, rgw_obj& target_obj,
uint64_t olh_epoch)
{
string op_tag;
continue;
}
- ret = update_olh(obj_ctx, state, bucket_owner, olh_obj);
+ ret = update_olh(obj_ctx, state, bucket_info, olh_obj);
if (ret < 0) {
ldout(cct, 20) << "update_olh() target_obj=" << target_obj << " returned " << ret << dendl;
continue;
if (ret < 0) {
ldout(cct, 0) << "ERROR: get_bucket_instance_info() returned " << ret << " olh_obj.bucket=" << olh_obj.bucket << dendl;
}
- ret = update_olh(obj_ctx, state, bucket_info.owner, olh_obj);
+ ret = update_olh(obj_ctx, state, bucket_info, olh_obj);
if (ret < 0) {
return ret;
}
class Object {
RGWRados *store;
+ RGWBucketInfo bucket_info;
RGWObjectCtx& ctx;
rgw_obj obj;
RGWObjState *state;
+ bool versioning_disabled;
+
protected:
int get_state(RGWObjState **pstate, bool follow_olh);
int complete_atomic_modification();
public:
- Object(RGWRados *_store, RGWObjectCtx& _ctx, rgw_obj& _obj) : store(_store), ctx(_ctx), obj(_obj), state(NULL) {}
+ Object(RGWRados *_store, RGWBucketInfo& _bucket_info, RGWObjectCtx& _ctx, rgw_obj& _obj) : store(_store), bucket_info(_bucket_info),
+ ctx(_ctx), obj(_obj), state(NULL), versioning_disabled(false) {}
RGWRados *get_store() { return store; }
rgw_obj& get_obj() { return obj; }
RGWObjectCtx& get_ctx() { return ctx; }
+ RGWBucketInfo& get_bucket_info() { return bucket_info; }
+
+ void set_versioning_disabled(bool status) {
+ versioning_disabled = status;
+ }
+
+ bool versioning_enabled() {
+ return (!versioning_disabled && bucket_info.versioning_enabled());
+ }
struct Read {
RGWRados::Object *source;
int bucket_suspended(rgw_bucket& bucket, bool *suspended);
/** Delete an object.*/
- virtual int delete_obj(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& src_obj, int versioning_status);
+ virtual int delete_obj(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_owner, rgw_obj& src_obj, int versioning_status);
/* Delete a system object */
virtual int delete_system_obj(rgw_obj& src_obj, RGWObjVersionTracker *objv_tracker = NULL);
int bucket_index_read_olh_log(RGWObjState& state, rgw_obj& obj_instance, uint64_t ver_marker,
map<uint64_t, vector<rgw_bucket_olh_log_entry> > *log, bool *is_truncated);
int bucket_index_trim_olh_log(RGWObjState& obj_state, rgw_obj& obj_instance, uint64_t ver);
- int apply_olh_log(RGWObjectCtx& ctx, RGWObjState& obj_state, const string& bucket_owner, rgw_obj& obj,
+ int apply_olh_log(RGWObjectCtx& ctx, RGWObjState& obj_state, RGWBucketInfo& bucket_info, rgw_obj& obj,
bufferlist& obj_tag, map<uint64_t, vector<rgw_bucket_olh_log_entry> >& log,
uint64_t *plast_ver);
- int update_olh(RGWObjectCtx& obj_ctx, RGWObjState *state, const string& bucket_owner, rgw_obj& obj);
- int set_olh(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj, bool delete_marker, rgw_bucket_dir_entry_meta *meta,
+ int update_olh(RGWObjectCtx& obj_ctx, RGWObjState *state, RGWBucketInfo& bucket_info, rgw_obj& obj);
+ int set_olh(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, rgw_obj& target_obj, bool delete_marker, rgw_bucket_dir_entry_meta *meta,
uint64_t olh_epoch);
- int unlink_obj_instance(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj,
+ int unlink_obj_instance(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, rgw_obj& target_obj,
uint64_t olh_epoch);
void check_pending_olh_entries(map<string, bufferlist>& pending_entries, map<string, bufferlist> *rm_pending_entries);
RGWRados *store;
RGWObjectCtx& obj_ctx;
bool is_complete;
- string bucket_owner;
+ RGWBucketInfo bucket_info;
virtual int do_complete(string& etag, time_t *mtime, time_t set_mtime,
map<string, bufferlist>& attrs,
const char *if_match = NULL, const char *if_nomatch = NULL) = 0;
public:
- RGWPutObjProcessor(RGWObjectCtx& _obj_ctx, const string& _bo) : store(NULL), obj_ctx(_obj_ctx), is_complete(false), bucket_owner(_bo) {}
+ RGWPutObjProcessor(RGWObjectCtx& _obj_ctx, RGWBucketInfo& _bi) : store(NULL), obj_ctx(_obj_ctx), is_complete(false), bucket_info(_bi) {}
virtual ~RGWPutObjProcessor() {}
virtual int prepare(RGWRados *_store, string *oid_rand) {
store = _store;
public:
int throttle_data(void *handle, bool need_to_wait);
- RGWPutObjProcessor_Aio(RGWObjectCtx& obj_ctx, const string& bucket_owner) : RGWPutObjProcessor(obj_ctx, bucket_owner), max_chunks(RGW_MAX_PENDING_CHUNKS), obj_len(0) {}
+ RGWPutObjProcessor_Aio(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info) : RGWPutObjProcessor(obj_ctx, bucket_info), max_chunks(RGW_MAX_PENDING_CHUNKS), obj_len(0) {}
virtual ~RGWPutObjProcessor_Aio();
};
public:
~RGWPutObjProcessor_Atomic() {}
- RGWPutObjProcessor_Atomic(RGWObjectCtx& obj_ctx, const string& bucket_owner,
+ RGWPutObjProcessor_Atomic(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info,
rgw_bucket& _b, const string& _o, uint64_t _p, const string& _t, bool versioned) :
- RGWPutObjProcessor_Aio(obj_ctx, bucket_owner),
+ RGWPutObjProcessor_Aio(obj_ctx, bucket_info),
part_size(_p),
cur_part_ofs(0),
next_part_ofs(_p),