aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-05-30 12:06:33 +0200
committerKevin Wolf <kwolf@redhat.com>2016-07-05 16:46:26 +0200
commit0d1049c7d1d4266a587be255ef0b602531c05456 (patch)
tree0b6a504ddf93305a8c86ee80541d8b36c93467b8
parentebb7af217339a971bbac91e3697ba76226154a8c (diff)
block: Convert bdrv_aio_writev() to BdrvChild
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--block/blkdebug.c2
-rw-r--r--block/blkverify.c4
-rw-r--r--block/io.c6
-rw-r--r--block/qed-table.c2
-rw-r--r--block/qed.c6
-rw-r--r--block/quorum.c4
-rw-r--r--include/block/block.h2
7 files changed, 13 insertions, 13 deletions
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 499de40e42..bbaa33fdd8 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -480,7 +480,7 @@ static BlockAIOCB *blkdebug_aio_writev(BlockDriverState *bs,
return inject_error(bs, cb, opaque, rule);
}
- return bdrv_aio_writev(bs->file->bs, sector_num, qiov, nb_sectors,
+ return bdrv_aio_writev(bs->file, sector_num, qiov, nb_sectors,
cb, opaque);
}
diff --git a/block/blkverify.c b/block/blkverify.c
index 4672fdadf4..da62d75969 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -262,9 +262,9 @@ static BlockAIOCB *blkverify_aio_writev(BlockDriverState *bs,
BlkverifyAIOCB *acb = blkverify_aio_get(bs, true, sector_num, qiov,
nb_sectors, cb, opaque);
- bdrv_aio_writev(s->test_file->bs, sector_num, qiov, nb_sectors,
+ bdrv_aio_writev(s->test_file, sector_num, qiov, nb_sectors,
blkverify_aio_cb, acb);
- bdrv_aio_writev(bs->file->bs, sector_num, qiov, nb_sectors,
+ bdrv_aio_writev(bs->file, sector_num, qiov, nb_sectors,
blkverify_aio_cb, acb);
return &acb->common;
}
diff --git a/block/io.c b/block/io.c
index 696a79d592..e92952128c 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1972,13 +1972,13 @@ BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num,
cb, opaque, false);
}
-BlockAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,
+BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num,
QEMUIOVector *qiov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque)
{
- trace_bdrv_aio_writev(bs, sector_num, nb_sectors, opaque);
+ trace_bdrv_aio_writev(child->bs, sector_num, nb_sectors, opaque);
- return bdrv_co_aio_rw_vector(bs, sector_num, qiov, nb_sectors, 0,
+ return bdrv_co_aio_rw_vector(child->bs, sector_num, qiov, nb_sectors, 0,
cb, opaque, true);
}
diff --git a/block/qed-table.c b/block/qed-table.c
index 2db0a332e9..1a731dff51 100644
--- a/block/qed-table.c
+++ b/block/qed-table.c
@@ -154,7 +154,7 @@ static void qed_write_table(BDRVQEDState *s, uint64_t offset, QEDTable *table,
/* Adjust for offset into table */
offset += start * sizeof(uint64_t);
- bdrv_aio_writev(s->bs->file->bs, offset / BDRV_SECTOR_SIZE,
+ bdrv_aio_writev(s->bs->file, offset / BDRV_SECTOR_SIZE,
&write_table_cb->qiov,
write_table_cb->qiov.size / BDRV_SECTOR_SIZE,
qed_write_table_cb, write_table_cb);
diff --git a/block/qed.c b/block/qed.c
index 7f71007ebb..9d3d588631 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -123,7 +123,7 @@ static void qed_write_header_read_cb(void *opaque, int ret)
/* Update header */
qed_header_cpu_to_le(&s->header, (QEDHeader *)write_header_cb->buf);
- bdrv_aio_writev(s->bs->file->bs, 0, &write_header_cb->qiov,
+ bdrv_aio_writev(s->bs->file, 0, &write_header_cb->qiov,
write_header_cb->nsectors, qed_write_header_cb,
write_header_cb);
}
@@ -837,7 +837,7 @@ static void qed_copy_from_backing_file_write(void *opaque, int ret)
}
BLKDBG_EVENT(s->bs->file, BLKDBG_COW_WRITE);
- bdrv_aio_writev(s->bs->file->bs, copy_cb->offset / BDRV_SECTOR_SIZE,
+ bdrv_aio_writev(s->bs->file, copy_cb->offset / BDRV_SECTOR_SIZE,
&copy_cb->qiov, copy_cb->qiov.size / BDRV_SECTOR_SIZE,
qed_copy_from_backing_file_cb, copy_cb);
}
@@ -1087,7 +1087,7 @@ static void qed_aio_write_main(void *opaque, int ret)
}
BLKDBG_EVENT(s->bs->file, BLKDBG_WRITE_AIO);
- bdrv_aio_writev(s->bs->file->bs, offset / BDRV_SECTOR_SIZE,
+ bdrv_aio_writev(s->bs->file, offset / BDRV_SECTOR_SIZE,
&acb->cur_qiov, acb->cur_qiov.size / BDRV_SECTOR_SIZE,
next_fn, acb);
}
diff --git a/block/quorum.c b/block/quorum.c
index c365c78f9b..9cf876fb34 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -383,7 +383,7 @@ static bool quorum_rewrite_bad_versions(BDRVQuorumState *s, QuorumAIOCB *acb,
continue;
}
QLIST_FOREACH(item, &version->items, next) {
- bdrv_aio_writev(s->children[item->index]->bs, acb->sector_num,
+ bdrv_aio_writev(s->children[item->index], acb->sector_num,
acb->qiov, acb->nb_sectors, quorum_rewrite_aio_cb,
acb);
}
@@ -719,7 +719,7 @@ static BlockAIOCB *quorum_aio_writev(BlockDriverState *bs,
int i;
for (i = 0; i < s->num_children; i++) {
- acb->qcrs[i].aiocb = bdrv_aio_writev(s->children[i]->bs, sector_num,
+ acb->qcrs[i].aiocb = bdrv_aio_writev(s->children[i], sector_num,
qiov, nb_sectors, &quorum_aio_cb,
&acb->qcrs[i]);
}
diff --git a/include/block/block.h b/include/block/block.h
index ac8a1d7e73..fce8c81424 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -313,7 +313,7 @@ BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num,
QEMUIOVector *iov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque);
-BlockAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,
+BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num,
QEMUIOVector *iov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque);
BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs,