Revision e183ef75
b/block/cow.c | ||
---|---|---|
226 | 226 |
return cow_update_bitmap(bs, sector_num, nb_sectors); |
227 | 227 |
} |
228 | 228 |
|
229 |
static coroutine_fn int cow_co_write(BlockDriverState *bs, int64_t sector_num, |
|
230 |
const uint8_t *buf, int nb_sectors) |
|
231 |
{ |
|
232 |
int ret; |
|
233 |
BDRVCowState *s = bs->opaque; |
|
234 |
qemu_co_mutex_lock(&s->lock); |
|
235 |
ret = cow_write(bs, sector_num, buf, nb_sectors); |
|
236 |
qemu_co_mutex_unlock(&s->lock); |
|
237 |
return ret; |
|
238 |
} |
|
239 |
|
|
229 | 240 |
static void cow_close(BlockDriverState *bs) |
230 | 241 |
{ |
231 | 242 |
} |
... | ... | |
320 | 331 |
.bdrv_probe = cow_probe, |
321 | 332 |
.bdrv_open = cow_open, |
322 | 333 |
.bdrv_read = cow_co_read, |
323 |
.bdrv_write = cow_write,
|
|
334 |
.bdrv_write = cow_co_write,
|
|
324 | 335 |
.bdrv_close = cow_close, |
325 | 336 |
.bdrv_create = cow_create, |
326 | 337 |
.bdrv_flush = cow_flush, |
b/block/nbd.c | ||
---|---|---|
251 | 251 |
return ret; |
252 | 252 |
} |
253 | 253 |
|
254 |
static coroutine_fn int nbd_co_write(BlockDriverState *bs, int64_t sector_num, |
|
255 |
const uint8_t *buf, int nb_sectors) |
|
256 |
{ |
|
257 |
int ret; |
|
258 |
BDRVNBDState *s = bs->opaque; |
|
259 |
qemu_co_mutex_lock(&s->lock); |
|
260 |
ret = nbd_write(bs, sector_num, buf, nb_sectors); |
|
261 |
qemu_co_mutex_unlock(&s->lock); |
|
262 |
return ret; |
|
263 |
} |
|
264 |
|
|
254 | 265 |
static void nbd_close(BlockDriverState *bs) |
255 | 266 |
{ |
256 | 267 |
BDRVNBDState *s = bs->opaque; |
... | ... | |
272 | 283 |
.instance_size = sizeof(BDRVNBDState), |
273 | 284 |
.bdrv_file_open = nbd_open, |
274 | 285 |
.bdrv_read = nbd_co_read, |
275 |
.bdrv_write = nbd_write,
|
|
286 |
.bdrv_write = nbd_co_write,
|
|
276 | 287 |
.bdrv_close = nbd_close, |
277 | 288 |
.bdrv_getlength = nbd_getlength, |
278 | 289 |
.protocol_name = "nbd", |
b/block/vmdk.c | ||
---|---|---|
1116 | 1116 |
return 0; |
1117 | 1117 |
} |
1118 | 1118 |
|
1119 |
static coroutine_fn int vmdk_co_write(BlockDriverState *bs, int64_t sector_num, |
|
1120 |
const uint8_t *buf, int nb_sectors) |
|
1121 |
{ |
|
1122 |
int ret; |
|
1123 |
BDRVVmdkState *s = bs->opaque; |
|
1124 |
qemu_co_mutex_lock(&s->lock); |
|
1125 |
ret = vmdk_write(bs, sector_num, buf, nb_sectors); |
|
1126 |
qemu_co_mutex_unlock(&s->lock); |
|
1127 |
return ret; |
|
1128 |
} |
|
1129 |
|
|
1119 | 1130 |
|
1120 | 1131 |
static int vmdk_create_extent(const char *filename, int64_t filesize, |
1121 | 1132 |
bool flat, bool compress) |
... | ... | |
1554 | 1565 |
.bdrv_probe = vmdk_probe, |
1555 | 1566 |
.bdrv_open = vmdk_open, |
1556 | 1567 |
.bdrv_read = vmdk_co_read, |
1557 |
.bdrv_write = vmdk_write, |
|
1568 |
.bdrv_write = vmdk_co_write,
|
|
1558 | 1569 |
.bdrv_close = vmdk_close, |
1559 | 1570 |
.bdrv_create = vmdk_create, |
1560 | 1571 |
.bdrv_flush = vmdk_flush, |
b/block/vpc.c | ||
---|---|---|
456 | 456 |
return 0; |
457 | 457 |
} |
458 | 458 |
|
459 |
static coroutine_fn int vpc_co_write(BlockDriverState *bs, int64_t sector_num, |
|
460 |
const uint8_t *buf, int nb_sectors) |
|
461 |
{ |
|
462 |
int ret; |
|
463 |
BDRVVPCState *s = bs->opaque; |
|
464 |
qemu_co_mutex_lock(&s->lock); |
|
465 |
ret = vpc_write(bs, sector_num, buf, nb_sectors); |
|
466 |
qemu_co_mutex_unlock(&s->lock); |
|
467 |
return ret; |
|
468 |
} |
|
469 |
|
|
459 | 470 |
static int vpc_flush(BlockDriverState *bs) |
460 | 471 |
{ |
461 | 472 |
return bdrv_flush(bs->file); |
... | ... | |
653 | 664 |
.bdrv_probe = vpc_probe, |
654 | 665 |
.bdrv_open = vpc_open, |
655 | 666 |
.bdrv_read = vpc_co_read, |
656 |
.bdrv_write = vpc_write, |
|
667 |
.bdrv_write = vpc_co_write,
|
|
657 | 668 |
.bdrv_flush = vpc_flush, |
658 | 669 |
.bdrv_close = vpc_close, |
659 | 670 |
.bdrv_create = vpc_create, |
b/block/vvfat.c | ||
---|---|---|
2727 | 2727 |
return 0; |
2728 | 2728 |
} |
2729 | 2729 |
|
2730 |
static coroutine_fn int vvfat_co_write(BlockDriverState *bs, int64_t sector_num, |
|
2731 |
const uint8_t *buf, int nb_sectors) |
|
2732 |
{ |
|
2733 |
int ret; |
|
2734 |
BDRVVVFATState *s = bs->opaque; |
|
2735 |
qemu_co_mutex_lock(&s->lock); |
|
2736 |
ret = vvfat_write(bs, sector_num, buf, nb_sectors); |
|
2737 |
qemu_co_mutex_unlock(&s->lock); |
|
2738 |
return ret; |
|
2739 |
} |
|
2740 |
|
|
2730 | 2741 |
static int vvfat_is_allocated(BlockDriverState *bs, |
2731 | 2742 |
int64_t sector_num, int nb_sectors, int* n) |
2732 | 2743 |
{ |
... | ... | |
2817 | 2828 |
.instance_size = sizeof(BDRVVVFATState), |
2818 | 2829 |
.bdrv_file_open = vvfat_open, |
2819 | 2830 |
.bdrv_read = vvfat_co_read, |
2820 |
.bdrv_write = vvfat_write,
|
|
2831 |
.bdrv_write = vvfat_co_write,
|
|
2821 | 2832 |
.bdrv_close = vvfat_close, |
2822 | 2833 |
.bdrv_is_allocated = vvfat_is_allocated, |
2823 | 2834 |
.protocol_name = "fat", |
Also available in: Unified diff