Message ID | 020c6e625af4fcf64859c4f37f11d04efbebb0aa.1588699789.git.berto@igalia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add subcluster allocation to qcow2 | expand |
On 5/5/20 12:38 PM, Alberto Garcia wrote: > This helper function tells us if a cluster is allocated (that is, > there is an associated host offset for it). > > Signed-off-by: Alberto Garcia <berto@igalia.com> > --- > block/qcow2.h | 6 ++++++ > 1 file changed, 6 insertions(+) Reviewed-by: Eric Blake <eblake@redhat.com> > > diff --git a/block/qcow2.h b/block/qcow2.h > index be7816a3b8..b5db8d2f36 100644 > --- a/block/qcow2.h > +++ b/block/qcow2.h > @@ -763,6 +763,12 @@ QCow2SubclusterType qcow2_get_subcluster_type(BlockDriverState *bs, > } > } > > +static inline bool qcow2_cluster_is_allocated(QCow2ClusterType type) > +{ > + return (type == QCOW2_CLUSTER_COMPRESSED || type == QCOW2_CLUSTER_NORMAL || > + type == QCOW2_CLUSTER_ZERO_ALLOC); > +} > + > /* Check whether refcounts are eager or lazy */ > static inline bool qcow2_need_accurate_refcounts(BDRVQcow2State *s) > { >
diff --git a/block/qcow2.h b/block/qcow2.h index be7816a3b8..b5db8d2f36 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -763,6 +763,12 @@ QCow2SubclusterType qcow2_get_subcluster_type(BlockDriverState *bs, } } +static inline bool qcow2_cluster_is_allocated(QCow2ClusterType type) +{ + return (type == QCOW2_CLUSTER_COMPRESSED || type == QCOW2_CLUSTER_NORMAL || + type == QCOW2_CLUSTER_ZERO_ALLOC); +} + /* Check whether refcounts are eager or lazy */ static inline bool qcow2_need_accurate_refcounts(BDRVQcow2State *s) {
This helper function tells us if a cluster is allocated (that is, there is an associated host offset for it). Signed-off-by: Alberto Garcia <berto@igalia.com> --- block/qcow2.h | 6 ++++++ 1 file changed, 6 insertions(+)