This is required when CopyupRequest would need to invoke
pre_object_map_update() as part of upcoming changes to
create fewer child image objects whenever possible.
CopyupRequest constructor accepts image extents as an
rvalue forcing the caller to transfer ownership to it
and leaving the original variable in an unspecified
stated making has_parent() return incorrect state when
invoked from CopyupRequest. Therefore, introduce a
private tracking state that can be used in place of
checking emptiness of parent image extents.
Signed-off-by: Venky Shankar <vshankar@redhat.com>
lderr(m_ictx->cct) << this << " compute_parent_extents: failed to "
<< "retrieve parent overlap: " << cpp_strerror(r)
<< dendl;
+ m_has_parent = false;
m_parent_extents.clear();
return false;
}
ldout(m_ictx->cct, 20) << this << " compute_parent_extents: "
<< "overlap " << parent_overlap << " "
<< "extents " << m_parent_extents << dendl;
+ m_has_parent = !m_parent_extents.empty();
return true;
}
return false;
virtual void send() = 0;
bool has_parent() const {
- return !m_parent_extents.empty();
+ return m_has_parent;
}
protected:
Context *m_completion;
Extents m_parent_extents;
bool m_hide_enoent;
+
+private:
+ bool m_has_parent = false;
};
template <typename ImageCtxT = ImageCtx>