Revision f8a2e5e3 block/vmdk.c
b/block/vmdk.c | ||
---|---|---|
861 | 861 |
return NULL; |
862 | 862 |
} |
863 | 863 |
|
864 |
static int vmdk_is_allocated(BlockDriverState *bs, int64_t sector_num,
|
|
865 |
int nb_sectors, int *pnum)
|
|
864 |
static int coroutine_fn vmdk_co_is_allocated(BlockDriverState *bs,
|
|
865 |
int64_t sector_num, int nb_sectors, int *pnum)
|
|
866 | 866 |
{ |
867 | 867 |
BDRVVmdkState *s = bs->opaque; |
868 | 868 |
int64_t index_in_cluster, n, ret; |
... | ... | |
873 | 873 |
if (!extent) { |
874 | 874 |
return 0; |
875 | 875 |
} |
876 |
qemu_co_mutex_lock(&s->lock); |
|
876 | 877 |
ret = get_cluster_offset(bs, extent, NULL, |
877 | 878 |
sector_num * 512, 0, &offset); |
879 |
qemu_co_mutex_unlock(&s->lock); |
|
878 | 880 |
/* get_cluster_offset returning 0 means success */ |
879 | 881 |
ret = !ret; |
880 | 882 |
|
... | ... | |
1596 | 1598 |
.bdrv_close = vmdk_close, |
1597 | 1599 |
.bdrv_create = vmdk_create, |
1598 | 1600 |
.bdrv_co_flush_to_disk = vmdk_co_flush, |
1599 |
.bdrv_is_allocated = vmdk_is_allocated,
|
|
1601 |
.bdrv_co_is_allocated = vmdk_co_is_allocated,
|
|
1600 | 1602 |
.bdrv_get_allocated_file_size = vmdk_get_allocated_file_size, |
1601 | 1603 |
|
1602 | 1604 |
.create_options = vmdk_create_options, |
Also available in: Unified diff