diff options
Diffstat (limited to 'block/io.c')
-rw-r--r-- | block/io.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -896,7 +896,6 @@ bdrv_driver_pwritev_compressed(BlockDriverState *bs, uint64_t offset, return -ENOTSUP; } - assert(QLIST_EMPTY(&bs->dirty_bitmaps)); return drv->bdrv_co_pwritev_compressed(bs, offset, bytes, qiov); } @@ -1318,6 +1317,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs, } else if (flags & BDRV_REQ_ZERO_WRITE) { bdrv_debug_event(bs, BLKDBG_PWRITEV_ZERO); ret = bdrv_co_do_pwrite_zeroes(bs, offset, bytes, flags); + } else if (flags & BDRV_REQ_WRITE_COMPRESSED) { + ret = bdrv_driver_pwritev_compressed(bs, offset, bytes, qiov); } else if (bytes <= max_transfer) { bdrv_debug_event(bs, BLKDBG_PWRITEV); ret = bdrv_driver_pwritev(bs, offset, bytes, qiov, flags); @@ -1569,14 +1570,9 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child, bytes = ROUND_UP(bytes, align); } - if (flags & BDRV_REQ_WRITE_COMPRESSED) { - ret = bdrv_driver_pwritev_compressed( - bs, offset, bytes, use_local_qiov ? &local_qiov : qiov); - } else { - ret = bdrv_aligned_pwritev(bs, &req, offset, bytes, align, - use_local_qiov ? &local_qiov : qiov, - flags); - } + ret = bdrv_aligned_pwritev(bs, &req, offset, bytes, align, + use_local_qiov ? &local_qiov : qiov, + flags); fail: |