[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MA
From: |
Peter Lieven |
Subject: |
Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MAY_UNMAP for block devices |
Date: |
Wed, 13 Nov 2013 15:14:01 +0100 |
Am 13.11.2013 um 10:44 schrieb Paolo Bonzini <address@hidden>:
> Il 13/11/2013 07:29, Peter Lieven ha scritto:
>> Wouldn't it be good to add bdi->can_write_zeroes_with_unmap here as well?
>
> We do:
>
>> + bdi->unallocated_blocks_are_zero = s->discard_zeroes;
>> + bdi->can_write_zeroes_with_unmap = s->discard_zeroes;
Sorry, I missed this.
>
>> This would automatically avoid full allocation when converting something to
>> a host device
>> supporting BLKDISCARDZEROES.
>
> Yes, that's (part of) the point of this patch.
>
> Regarding the question you posed in the previous patch:
>
>> does BLKDISCARDZEROES ioctl guarantee that a device is
>> zero initialized or does it just guarantee that a discard may not
>> fail and that it reads as zeroes afterwards?
>
> Only the latter. ".bdrv_has_zero_init" is only present in the bdrv_file
> BlockDriver.
Then bdi->unallocated_blocks_are_zero must stay 0. .bdrv_has_zero_init's
semantic is to reflect the zero status of all blocks of the device right after
bdrv_create
independently of their allocation status. bdi->unallocated_blocks_are_zero
reflects the zero status of every unallocated block regardless if it was
unallocated right from the beginning or became unallocated through a discard.
Peter
- Re: [Qemu-devel] [PATCH 06/11] scsi-disk: correctly implement WRITE SAME, (continued)
[Qemu-devel] [PATCH 11/11] qemu-iotests: 033 is fast, Paolo Bonzini, 2013/11/12
[Qemu-devel] [PATCH 05/11] scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commands, Paolo Bonzini, 2013/11/12