mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
qcow2: Finalise interface of handle_alloc()
The interface works completely on a byte granularity now and duplicated parameters are removed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
3b8e2e260c
commit
c37f4cd71d
2 changed files with 21 additions and 13 deletions
|
@ -271,6 +271,11 @@ static inline int64_t start_of_cluster(BDRVQcowState *s, int64_t offset)
|
|||
return offset & ~(s->cluster_size - 1);
|
||||
}
|
||||
|
||||
static inline int64_t offset_into_cluster(BDRVQcowState *s, int64_t offset)
|
||||
{
|
||||
return offset & (s->cluster_size - 1);
|
||||
}
|
||||
|
||||
static inline int size_to_clusters(BDRVQcowState *s, int64_t size)
|
||||
{
|
||||
return (size + (s->cluster_size - 1)) >> s->cluster_bits;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue