On 09/17/2013 07:48 AM, Peter Lieven wrote:
> Signed-off-by: Peter Lieven <p...@kamp.de>
> ---
>  block.c |   34 +++++++++++++++++++++++++++++++++-
>  1 file changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index 74ec342..ecc5be4 100644
> --- a/block.c
> +++ b/block.c
> @@ -4181,7 +4181,39 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, 
> int64_t sector_num,
>      }
>  
>      if (bs->drv->bdrv_co_discard) {
> -        return bs->drv->bdrv_co_discard(bs, sector_num, nb_sectors);
> +        /* if no limit is specified in the BlockDriverState use a default
> +         * of 32768 512-byte sectors (16 MiB) per request.
> +         */
> +        int max_discard = bs->max_discard ? bs->max_discard : 32768;

Worth having a named constant instead of a magic number?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to