loc.clear();
}
+ bool have_null_instance() {
+ return instance == "null";
+ }
+
bool have_instance() {
- return !instance.empty() && instance != "null";
+ return !instance.empty();
+ }
+
+ bool need_to_encode_instance() {
+ return have_instance() && !have_null_instance();
}
void set_obj(const string& o) {
object.reserve(128);
orig_obj = o;
- if (ns.empty() && !have_instance()) {
+ if (ns.empty() && !need_to_encode_instance()) {
if (o.empty()) {
return;
}
} else {
object = "_";
object.append(ns);
- if (have_instance()) {
+ if (need_to_encode_instance()) {
object.append(string(":") + instance);
}
object.append("_");
int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh)
#warning FIXME: get rid objv_tracker for non system objects
{
+ bool need_follow_olh = follow_olh && !obj.have_instance();
+
RGWObjState *s = rctx->get_state(obj);
ldout(cct, 20) << "get_obj_state: rctx=" << (void *)rctx << " obj=" << obj << " state=" << (void *)s << " s->prefetch_data=" << s->prefetch_data << dendl;
*state = s;
if (s->has_attrs) {
- if (s->is_olh && follow_olh) {
+ if (s->is_olh && need_follow_olh) {
return get_olh_target_state(*rctx, obj, s, state, objv_tracker);
}
return 0;
if (is_olh(s->attrset)) {
s->is_olh = true;
- if (follow_olh) {
+ if (need_follow_olh) {
return get_olh_target_state(*rctx, obj, s, state, objv_tracker);
}
}