[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 37/41] cow: use bdrv_co_is_allocated()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 37/41] cow: use bdrv_co_is_allocated() |
Date: |
Mon, 5 Dec 2011 15:21:14 +0100 |
From: Stefan Hajnoczi <address@hidden>
Now that bdrv_co_is_allocated() is available we can use it instead of
the synchronous bdrv_is_allocated() interface. This is a follow-up that
Kevin Wolf <address@hidden> pointed out after applying the series that
introduces bdrv_co_is_allocated().
It is safe to make cow_read() a coroutine_fn because its only caller is
a coroutine_fn.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/cow.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/cow.c b/block/cow.c
index 7ae887b..586493c 100644
--- a/block/cow.c
+++ b/block/cow.c
@@ -171,14 +171,14 @@ static int cow_update_bitmap(BlockDriverState *bs,
int64_t sector_num,
return error;
}
-static int cow_read(BlockDriverState *bs, int64_t sector_num,
- uint8_t *buf, int nb_sectors)
+static int coroutine_fn cow_read(BlockDriverState *bs, int64_t sector_num,
+ uint8_t *buf, int nb_sectors)
{
BDRVCowState *s = bs->opaque;
int ret, n;
while (nb_sectors > 0) {
- if (bdrv_is_allocated(bs, sector_num, nb_sectors, &n)) {
+ if (bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n)) {
ret = bdrv_pread(bs->file,
s->cow_sectors_offset + sector_num * 512,
buf, n * 512);
--
1.7.6.4
- [Qemu-devel] [PATCH 20/41] block: use public bdrv_is_allocated() interface, (continued)
- [Qemu-devel] [PATCH 20/41] block: use public bdrv_is_allocated() interface, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 23/41] block: convert qcow2, qcow2, and vmdk to .bdrv_co_is_allocated(), Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 21/41] block: add .bdrv_co_is_allocated(), Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 25/41] vdi: convert to .bdrv_co_is_allocated(), Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 29/41] qemu-common: add QEMU_ALIGN_DOWN() and QEMU_ALIGN_UP() macros, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 31/41] block: add request tracking, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 30/41] coroutine: add qemu_co_queue_restart_all(), Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 28/41] block: add bdrv_co_is_allocated() interface, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 32/41] block: add interface to toggle copy-on-read, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 39/41] block: implement bdrv_co_is_allocated() boundary cases, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 37/41] cow: use bdrv_co_is_allocated(),
Kevin Wolf <=
- [Qemu-devel] [PATCH 35/41] block: core copy-on-read logic, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 36/41] block: add -drive copy-on-read=on|off, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 34/41] block: request overlap detection, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 40/41] block: wait_for_overlapping_requests() deadlock detection, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 41/41] block: convert qemu_aio_flush() calls to bdrv_drain_all(), Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 33/41] block: wait for overlapping requests, Kevin Wolf, 2011/12/05
- [Qemu-devel] [PATCH 38/41] dma-helpers: Add trace events, Kevin Wolf, 2011/12/05