if (op.recovery_progress.first && op.obc) {
/* We've got the attrs and the hinfo, might as well use them */
- op.hinfo = get_hash_info(op.hoid, false, &op.obc->attr_cache);
+ op.hinfo = get_hash_info(op.hoid, false, op.obc->attr_cache);
if (!op.hinfo) {
derr << __func__ << ": " << op.hoid << " has inconsistent hinfo"
<< dendl;
map<string, bufferlist, less<>> attrs;
int r = PGBackend::objects_get_attrs(i->first, &attrs);
if (r >= 0) {
- hinfo = get_hash_info(i->first, false, &attrs);
+ hinfo = get_hash_info(i->first, false, attrs);
} else {
derr << "get_hash_info" << ": stat " << i->first << " failed: "
<< cpp_strerror(r) << dendl;
sinfo,
*(op->t),
[&](const hobject_t &i) {
- ECUtil::HashInfoRef ref = get_hash_info(i, true, &op->t->obc_map[hoid]->attr_cache);
+ ECUtil::HashInfoRef ref = get_hash_info(i, true, op->t->obc_map[hoid]->attr_cache);
if (!ref) {
derr << __func__ << ": get_hash_info(" << i << ")"
<< " returned a null pointer and there is no "
ECUtil::HashInfoRef ECBackend::get_hash_info(
- const hobject_t &hoid, bool create, const map<string,bufferlist,less<>> *attrs)
+ const hobject_t &hoid, bool create, const map<string,bufferlist,less<>>& attrs)
{
dout(10) << __func__ << ": Getting attr on " << hoid << dendl;
ECUtil::HashInfoRef ref = unstable_hashinfo_registry.lookup(hoid);
if (r >= 0) {
dout(10) << __func__ << ": found on disk, size " << st.st_size << dendl;
bufferlist bl;
- ceph_assert(attrs);
- map<string, bufferlist>::const_iterator k = attrs->find(ECUtil::get_hinfo_key());
- if (k == attrs->end()) {
+ map<string, bufferlist>::const_iterator k = attrs.find(ECUtil::get_hinfo_key());
+ if (k == attrs.end()) {
dout(5) << __func__ << " " << hoid << " missing hinfo attr" << dendl;
} else {
bl = k->second;
return -EINPROGRESS;
}
- ECUtil::HashInfoRef hinfo = get_hash_info(poid, false, &o.attrs);
+ ECUtil::HashInfoRef hinfo = get_hash_info(poid, false, o.attrs);
if (!hinfo) {
dout(0) << "_scan_list " << poid << " could not retrieve hash info" << dendl;
o.read_error = true;
/// If modified, ensure that the ref is held until the update is applied
SharedPtrRegistry<hobject_t, ECUtil::HashInfo> unstable_hashinfo_registry;
ECUtil::HashInfoRef get_hash_info(const hobject_t &hoid, bool create,
- const std::map<std::string, ceph::buffer::list, std::less<>> *attr);
+ const std::map<std::string, ceph::buffer::list, std::less<>>& attr);
public:
ECBackend(