mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
qcow2: Use bytes instead of sectors for QCowL2Meta
In preparation for implementing .bdrv_co_pwritev in qcow2. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
aaa4d20b49
commit
8556739355
2 changed files with 15 additions and 30 deletions
|
@ -302,8 +302,8 @@ typedef struct Qcow2COWRegion {
|
|||
*/
|
||||
uint64_t offset;
|
||||
|
||||
/** Number of sectors to copy */
|
||||
int nb_sectors;
|
||||
/** Number of bytes to copy */
|
||||
int nb_bytes;
|
||||
} Qcow2COWRegion;
|
||||
|
||||
/**
|
||||
|
@ -318,12 +318,6 @@ typedef struct QCowL2Meta
|
|||
/** Host offset of the first newly allocated cluster */
|
||||
uint64_t alloc_offset;
|
||||
|
||||
/**
|
||||
* Number of sectors from the start of the first allocated cluster to
|
||||
* the end of the (possibly shortened) request
|
||||
*/
|
||||
int nb_available;
|
||||
|
||||
/** Number of newly allocated clusters */
|
||||
int nb_clusters;
|
||||
|
||||
|
@ -471,8 +465,7 @@ static inline uint64_t l2meta_cow_start(QCowL2Meta *m)
|
|||
|
||||
static inline uint64_t l2meta_cow_end(QCowL2Meta *m)
|
||||
{
|
||||
return m->offset + m->cow_end.offset
|
||||
+ (m->cow_end.nb_sectors << BDRV_SECTOR_BITS);
|
||||
return m->offset + m->cow_end.offset + m->cow_end.nb_bytes;
|
||||
}
|
||||
|
||||
static inline uint64_t refcount_diff(uint64_t r1, uint64_t r2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue