if (!complete || !recovery_info.object_exist) {
t->remove(coll->get_cid(), target_oid);
t->touch(coll->get_cid(), target_oid);
- bufferlist bv = attrs.at(OI_ATTR);
- object_info_t oi(bv);
+ object_info_t oi(attrs.at(OI_ATTR));
t->set_alloc_hint(coll->get_cid(), target_oid,
oi.expected_object_size,
oi.expected_write_size,
bufferlist bv;
bv.push_back(p->second.attrs[OI_ATTR]);
try {
- oi = object_info_t(); // Initialize optional<> before decode into it
- oi->decode(bv);
+ oi = object_info_t(bv);
} catch (ceph::buffer::error& e) {
oi = std::nullopt;
m_osds->clog->error() << mode << " " << info.pgid << " " << soid
if (!complete) {
t->remove(coll, ghobject_t(target_oid));
t->touch(coll, ghobject_t(target_oid));
- bufferlist bv = attrs.at(OI_ATTR);
- object_info_t oi(bv);
+ object_info_t oi(attrs.at(OI_ATTR));
t->set_alloc_hint(coll, ghobject_t(target_oid),
oi.expected_object_size,
oi.expected_write_size,
if (!recovery_info.object_exist) {
t->remove(coll, ghobject_t(target_oid));
t->touch(coll, ghobject_t(target_oid));
- bufferlist bv = attrs.at(OI_ATTR);
- object_info_t oi(bv);
+ object_info_t oi(attrs.at(OI_ATTR));
t->set_alloc_hint(coll, ghobject_t(target_oid),
oi.expected_object_size,
oi.expected_write_size,
}
// Debug
- bufferlist bv = out_op->attrset[OI_ATTR];
try {
- auto bliter = bv.cbegin();
- decode(oi, bliter);
+ oi.decode(out_op->attrset[OI_ATTR]);
} catch (...) {
dout(0) << __func__ << ": bad object_info_t: " << recovery_info.soid << dendl;
return -EINVAL;