class rgw_obj {
std::string orig_obj;
- std::string orig_key;
- std::string key;
+ std::string orig_loc;
+ std::string loc;
std::string object;
std::string instance;
public:
const std::string& get_object() const { return object; }
- const std::string& get_key() const { return key; }
+ const std::string& get_loc() const { return loc; }
const std::string& get_instance() const { return instance; }
rgw_bucket bucket;
std::string ns;
bucket = b;
set_ns(n);
set_obj(o);
- set_key(k);
+ set_loc(k);
}
void init(rgw_bucket& b, const std::string& o, const std::string& k) {
bucket = b;
set_obj(o);
- set_key(k);
+ set_loc(k);
}
void init(rgw_bucket& b, const std::string& o) {
bucket = b;
set_obj(o);
- orig_key = key = o;
+ orig_loc = loc = o;
}
void init_ns(rgw_bucket& b, const std::string& o, const std::string& n) {
bucket = b;
set_ns(n);
set_obj(o);
- reset_key();
+ reset_loc();
}
int set_ns(const char *n) {
if (!n)
set_obj(orig_obj);
return 0;
}
- void set_instance(const string& i) {
+ int set_instance(const string& i) {
if (i[0] == '_')
return -EINVAL;
instance = i;
set_obj(orig_obj);
+ return 0;
}
- void set_key(const string& k) {
- orig_key = k;
- key = k;
+ void set_loc(const string& k) {
+ orig_loc = k;
+ loc = k;
}
- void reset_key() {
- orig_key.clear();
- key.clear();
+ void reset_loc() {
+ orig_loc.clear();
+ loc.clear();
}
void set_obj(const string& o) {
object.append("_");
object.append(o);
}
- if (orig_key.size())
- set_key(orig_key);
+ if (orig_loc.size())
+ set_loc(orig_loc);
else
- set_key(orig_obj);
+ set_loc(orig_obj);
}
/*
void encode(bufferlist& bl) const {
ENCODE_START(4, 3, bl);
::encode(bucket.name, bl);
- ::encode(key, bl);
+ ::encode(loc, bl);
::encode(ns, bl);
::encode(object, bl);
::encode(bucket, bl);
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(4, 3, 3, bl);
::decode(bucket.name, bl);
- ::decode(key, bl);
+ ::decode(loc, bl);
::decode(ns, bl);
::decode(object, bl);
if (struct_v >= 2)
void rgw_obj::dump(Formatter *f) const
{
encode_json("bucket", bucket, f);
- encode_json("key", key, f);
+ encode_json("key", loc, f);
encode_json("ns", ns, f);
encode_json("object", object, f);
}
return r;
ObjectWriteOperation o;
- cls_rgw_bucket_prepare_op(o, op, tag, obj.get_index_key(), obj.get_instance(), obj.get_key(), zone_public_config.log_data);
+ cls_rgw_bucket_prepare_op(o, op, tag, obj.get_index_key(), obj.get_instance(), obj.get_loc(), zone_public_config.log_data);
r = index_ctx.operate(oid, &o);
return r;
}
{
bucket = obj.bucket;
prepend_bucket_marker(bucket, obj.get_object(), oid);
- prepend_bucket_marker(bucket, obj.get_key(), key);
+ prepend_bucket_marker(bucket, obj.get_loc(), key);
}
int rgw_policy_from_attrset(CephContext *cct, map<string, bufferlist>& attrset, RGWAccessControlPolicy *policy);