CephContext *cct = m_image_ctx.cct;
ldout(cct, 10) << this << " " << __func__ << ": r=" << *result << dendl;
- if (*result == 0) {
+ if (*result >= 0) {
auto it = m_out_bl.cbegin();
*result = cls_client::migration_get_finish(&it, &m_migration_spec);
} else if (*result == -ENOENT) {
std::vector<std::string> snap_names;
std::vector<uint64_t> snap_sizes;
- if (*result == 0) {
+ if (*result >= 0) {
auto it = m_out_bl.cbegin();
*result = cls_client::old_snapshot_list_finish(&it, &snap_names,
&snap_sizes, &m_snapc);
ldout(cct, 10) << this << " " << __func__ << ": "
<< "r=" << *result << dendl;
- if (*result == 0) {
+ if (*result >= 0) {
auto it = m_out_bl.cbegin();
ClsLockType lock_type;
*result = rados::cls::lock::get_lock_info_finish(&it, &m_lockers,
&lock_type, &m_lock_tag);
- if (*result == 0) {
+ if (*result >= 0) {
m_exclusive_locked = (lock_type == ClsLockType::EXCLUSIVE);
}
}
+
if (*result < 0) {
lderr(cct) << "failed to retrieve locks: " << cpp_strerror(*result)
<< dendl;
}
if (*result >= 0) {
- ClsLockType lock_type = ClsLockType::NONE;
+ ClsLockType lock_type;
*result = rados::cls::lock::get_lock_info_finish(&it, &m_lockers,
&lock_type, &m_lock_tag);
- if (*result == 0) {
+ if (*result >= 0) {
m_exclusive_locked = (lock_type == ClsLockType::EXCLUSIVE);
}
}
auto it = m_out_bl.cbegin();
if (!m_legacy_parent) {
- if (*result == 0) {
+ if (*result >= 0) {
*result = cls_client::parent_get_finish(&it, &m_parent_md.spec);
}
std::optional<uint64_t> parent_overlap;
- if (*result == 0) {
+ if (*result >= 0) {
*result = cls_client::parent_overlap_get_finish(&it, &parent_overlap);
}
- if (*result == 0 && parent_overlap) {
+ if (*result >= 0 && parent_overlap) {
m_parent_md.overlap = *parent_overlap;
m_head_parent_overlap = true;
}
- } else if (*result == 0) {
+ } else if (*result >= 0) {
*result = cls_client::get_parent_finish(&it, &m_parent_md.spec,
&m_parent_md.overlap);
m_head_parent_overlap = true;
m_legacy_parent = true;
send_v2_get_parent();
return nullptr;
- } if (*result < 0) {
+ } else if (*result < 0) {
lderr(cct) << "failed to retrieve parent: " << cpp_strerror(*result)
<< dendl;
return m_on_finish;
// -EOPNOTSUPP handler not required since feature bit implies OSD
// supports the method
- if (*result == 0) {
+ if (*result >= 0) {
auto it = m_out_bl.cbegin();
- cls_client::op_features_get_finish(&it, &m_op_features);
- } else if (*result < 0) {
+ *result = cls_client::op_features_get_finish(&it, &m_op_features);
+ }
+
+ if (*result < 0) {
lderr(cct) << "failed to retrieve op features: " << cpp_strerror(*result)
<< dendl;
return m_on_finish;
ldout(cct, 10) << this << " " << __func__ << ": "
<< "r=" << *result << dendl;
- if (*result == 0) {
+ if (*result >= 0) {
auto it = m_out_bl.cbegin();
- cls_client::image_group_get_finish(&it, &m_group_spec);
+ *result = cls_client::image_group_get_finish(&it, &m_group_spec);
}
+
if (*result < 0 && *result != -EOPNOTSUPP) {
lderr(cct) << "failed to retrieve group: " << cpp_strerror(*result)
<< dendl;
*result = cls_client::snapshot_get_finish(&it, &m_snap_infos[i]);
}
- if (*result == 0) {
+ if (*result >= 0) {
if (m_legacy_parent) {
*result = cls_client::get_parent_finish(&it, &m_snap_parents[i].spec,
&m_snap_parents[i].overlap);
} else {
std::optional<uint64_t> parent_overlap;
*result = cls_client::parent_overlap_get_finish(&it, &parent_overlap);
- if (*result == 0 && parent_overlap && m_parent_md.spec.pool_id > -1) {
+ if (*result >= 0 && parent_overlap && m_parent_md.spec.pool_id > -1) {
m_snap_parents[i].spec = m_parent_md.spec;
m_snap_parents[i].overlap = *parent_overlap;
}