[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/10] block/json: Add functions for writing zer
From: |
Benoît Canet |
Subject: |
Re: [Qemu-devel] [PATCH 04/10] block/json: Add functions for writing zeroes etc. |
Date: |
Wed, 5 Mar 2014 17:09:08 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
The Monday 03 Mar 2014 à 16:28:47 (+0100), Max Reitz wrote :
> Add passthrough functions for bdrv_aio_discard(),
> bdrv_co_write_zeroes(), bdrv_truncate() and bdrv_has_zero_init().
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/json.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/block/json.c b/block/json.c
> index 2f885cc..a2f4691 100644
> --- a/block/json.c
> +++ b/block/json.c
> @@ -98,6 +98,21 @@ static BlockDriverAIOCB *json_aio_flush(BlockDriverState
> *bs,
> return bdrv_aio_flush(bs->file, cb, opaque);
> }
>
> +static BlockDriverAIOCB *json_aio_discard(BlockDriverState *bs,
> + int64_t sector_num, int nb_sectors,
> + BlockDriverCompletionFunc *cb,
> + void *opaque)
> +{
> + return bdrv_aio_discard(bs, sector_num, nb_sectors, cb, opaque);
Isn't it bs->file ?
> +}
> +
> +static coroutine_fn int json_co_write_zeroes(BlockDriverState *bs,
> + int64_t sector_num, int
> nb_sectors,
> + BdrvRequestFlags flags)
> +{
> + return bdrv_co_write_zeroes(bs, sector_num, nb_sectors, flags);
same
> +}
> +
> static void json_invalidate_cache(BlockDriverState *bs)
> {
> return bdrv_invalidate_cache(bs->file);
> @@ -108,6 +123,16 @@ static int64_t json_getlength(BlockDriverState *bs)
> return bdrv_getlength(bs->file);
> }
>
> +static int json_truncate(BlockDriverState *bs, int64_t offset)
> +{
> + return bdrv_truncate(bs->file, offset);
> +}
> +
> +static int json_has_zero_init(BlockDriverState *bs)
> +{
> + return bdrv_has_zero_init(bs->file);
> +}
> +
> static int json_refresh_limits(BlockDriverState *bs)
> {
> bs->bl = bs->file->bl;
> @@ -131,12 +156,17 @@ static BlockDriver bdrv_json = {
> .bdrv_aio_readv = json_aio_readv,
> .bdrv_aio_writev = json_aio_writev,
> .bdrv_aio_flush = json_aio_flush,
> + .bdrv_aio_discard = json_aio_discard,
> +
> + .bdrv_co_write_zeroes = json_co_write_zeroes,
>
> .bdrv_invalidate_cache = json_invalidate_cache,
>
> .has_variable_length = true,
> .bdrv_getlength = json_getlength,
> + .bdrv_truncate = json_truncate,
>
> + .bdrv_has_zero_init = json_has_zero_init,
> .bdrv_refresh_limits = json_refresh_limits,
> .bdrv_get_info = json_get_info,
>
> --
> 1.9.0
>
>
- Re: [Qemu-devel] [PATCH 01/10] qdict: Add qdict_join(), (continued)
[Qemu-devel] [PATCH 04/10] block/json: Add functions for writing zeroes etc., Max Reitz, 2014/03/03
- Re: [Qemu-devel] [PATCH 04/10] block/json: Add functions for writing zeroes etc.,
Benoît Canet <=
[Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status(), Max Reitz, 2014/03/03
- Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status(), Benoît Canet, 2014/03/05
- Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status(), Max Reitz, 2014/03/05
- Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status(), Benoît Canet, 2014/03/05
- Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status(), Max Reitz, 2014/03/05
- Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status(), Benoît Canet, 2014/03/05
- Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status(), Max Reitz, 2014/03/06
[Qemu-devel] [PATCH 07/10] block/json: Add bdrv_get_specific_info(), Max Reitz, 2014/03/03