diff mbox series

[v2,1/5] qcow2: Replace bdrv_write() with bdrv_pwrite()

Message ID 09c6ad4af497136c11291257ee8bf10608e2b86e.1556732434.git.berto@igalia.com
State New
Headers show
Series Remove bdrv_read() and bdrv_write() | expand

Commit Message

Alberto Garcia May 1, 2019, 6:13 p.m. UTC
There's only one bdrv_write() call left in the qcow2 code, and it can
be trivially replaced with the byte-based bdrv_pwrite().

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
 block/qcow2-refcount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vladimir Sementsov-Ogievskiy May 6, 2019, 3:58 p.m. UTC | #1
01.05.2019 21:13, Alberto Garcia wrote:
> There's only one bdrv_write() call left in the qcow2 code, and it can
> be trivially replaced with the byte-based bdrv_pwrite().
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
diff mbox series

Patch

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index e0fe322500..83f66eed7a 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -2409,8 +2409,8 @@  write_refblocks:
         on_disk_refblock = (void *)((char *) *refcount_table +
                                     refblock_index * s->cluster_size);
 
-        ret = bdrv_write(bs->file, refblock_offset / BDRV_SECTOR_SIZE,
-                         on_disk_refblock, s->cluster_sectors);
+        ret = bdrv_pwrite(bs->file, refblock_offset, on_disk_refblock,
+                          s->cluster_size);
         if (ret < 0) {
             fprintf(stderr, "ERROR writing refblock: %s\n", strerror(-ret));
             goto fail;