aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-cluster.c
diff options
context:
space:
mode:
authorAlberto Faria <afaria@redhat.com>2022-06-09 16:27:36 +0100
committerHanna Reitz <hreitz@redhat.com>2022-07-12 12:14:55 +0200
commit32cc71def9e3885f9527af713e6d8dc7521ddc08 (patch)
tree9ec7c6a1c10523d79b9b8aeb4ba6ace82c3f5b87 /block/qcow2-cluster.c
parent53fb7844f03241a0e6de2c342c9e1b89df12da4d (diff)
block: Change bdrv_{pread,pwrite,pwrite_sync}() param order
Swap 'buf' and 'bytes' around for consistency with bdrv_co_{pread,pwrite}(), and in preparation to implement these functions using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pread(child, offset, buf, bytes, flags) + bdrv_pread(child, offset, bytes, buf, flags) @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pwrite(child, offset, buf, bytes, flags) + bdrv_pwrite(child, offset, bytes, buf, flags) @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pwrite_sync(child, offset, buf, bytes, flags) + bdrv_pwrite_sync(child, offset, bytes, buf, flags) Resulting overly-long lines were then fixed by hand. Signed-off-by: Alberto Faria <afaria@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-Id: <20220609152744.3891847-3-afaria@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'block/qcow2-cluster.c')
-rw-r--r--block/qcow2-cluster.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index ad7107a795..fd32316d6f 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -159,8 +159,8 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_WRITE_TABLE);
for(i = 0; i < s->l1_size; i++)
new_l1_table[i] = cpu_to_be64(new_l1_table[i]);
- ret = bdrv_pwrite_sync(bs->file, new_l1_table_offset, new_l1_table,
- new_l1_size2, 0);
+ ret = bdrv_pwrite_sync(bs->file, new_l1_table_offset, new_l1_size2,
+ new_l1_table, 0);
if (ret < 0)
goto fail;
for(i = 0; i < s->l1_size; i++)
@@ -170,8 +170,8 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_ACTIVATE_TABLE);
stl_be_p(data, new_l1_size);
stq_be_p(data + 4, new_l1_table_offset);
- ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, l1_size), data,
- sizeof(data), 0);
+ ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, l1_size),
+ sizeof(data), data, 0);
if (ret < 0) {
goto fail;
}
@@ -249,7 +249,7 @@ int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index)
BLKDBG_EVENT(bs->file, BLKDBG_L1_UPDATE);
ret = bdrv_pwrite_sync(bs->file,
s->l1_table_offset + L1E_SIZE * l1_start_index,
- buf, bufsize, 0);
+ bufsize, buf, 0);
if (ret < 0) {
return ret;
}
@@ -2260,8 +2260,8 @@ static int expand_zero_clusters_in_l1(BlockDriverState *bs, uint64_t *l1_table,
(void **)&l2_slice);
} else {
/* load inactive L2 tables from disk */
- ret = bdrv_pread(bs->file, slice_offset, l2_slice,
- slice_size2, 0);
+ ret = bdrv_pread(bs->file, slice_offset, slice_size2,
+ l2_slice, 0);
}
if (ret < 0) {
goto fail;
@@ -2377,8 +2377,8 @@ static int expand_zero_clusters_in_l1(BlockDriverState *bs, uint64_t *l1_table,
goto fail;
}
- ret = bdrv_pwrite(bs->file, slice_offset, l2_slice,
- slice_size2, 0);
+ ret = bdrv_pwrite(bs->file, slice_offset, slice_size2,
+ l2_slice, 0);
if (ret < 0) {
goto fail;
}
@@ -2471,8 +2471,8 @@ int qcow2_expand_zero_clusters(BlockDriverState *bs,
l1_table = new_l1_table;
- ret = bdrv_pread(bs->file, s->snapshots[i].l1_table_offset, l1_table,
- l1_size2, 0);
+ ret = bdrv_pread(bs->file, s->snapshots[i].l1_table_offset, l1_size2,
+ l1_table, 0);
if (ret < 0) {
goto fail;
}