|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MAY_UNMAP for block devices |
Date: | Wed, 13 Nov 2013 15:39:43 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
Il 13/11/2013 15:14, Peter Lieven ha scritto: >>> >> 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. What we have is: * bdi->unallocated_blocks_are_zero returns true * bdrv_create doesn't ensure that every block starts unallocated * hence bdrv_has_zero_init returns false Blocks that (for any reason) are unallocated after bdrv_create *will* be zero if BLKDISCARDZEROES returns true. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |