From 751e2f0698c284b4924d83ec63fa4e834bf4c80d Mon Sep 17 00:00:00 2001 From: Pavel Butsykin Date: Fri, 22 Jul 2016 11:17:41 +0300 Subject: [PATCH] block: Convert bdrv_pwrite_compressed() to BdrvChild Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 2 +- block/io.c | 3 ++- include/block/block.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 4c704a134f..76ea45955f 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1493,7 +1493,7 @@ int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *buf, return ret; } - return bdrv_pwrite_compressed(blk_bs(blk), offset, buf, count); + return bdrv_pwrite_compressed(blk->root, offset, buf, count); } int blk_truncate(BlockBackend *blk, int64_t offset) diff --git a/block/io.c b/block/io.c index da874d0f19..c528fead1b 100644 --- a/block/io.c +++ b/block/io.c @@ -1868,9 +1868,10 @@ int bdrv_is_allocated_above(BlockDriverState *top, return 0; } -int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, +int bdrv_pwrite_compressed(BdrvChild *child, int64_t offset, const void *buf, int bytes) { + BlockDriverState *bs = child->bs; BlockDriver *drv = bs->drv; int ret; diff --git a/include/block/block.h b/include/block/block.h index b4a97f2612..7bb5ddbf73 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -399,7 +399,7 @@ const char *bdrv_get_node_name(const BlockDriverState *bs); const char *bdrv_get_device_name(const BlockDriverState *bs); const char *bdrv_get_device_or_node_name(const BlockDriverState *bs); int bdrv_get_flags(BlockDriverState *bs); -int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, +int bdrv_pwrite_compressed(BdrvChild *child, int64_t offset, const void *buf, int bytes); int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs);