Commit Message

the BDRV_REQ_MAY_UNMAP flag is used to indicate that block driver
is allowed to optimze a write zeroes request by unmapping (discarding)
blocks if it is guaranteed that the result will read back as
zeroes.
the flag is only passed to the driver if the block device is
opened with BDRV_O_UNMAP.
Signed-off-by: Peter Lieven <pl@kamp.de>
---
block-migration.c | 3 ++-
block.c | 4 ++++
block/backup.c | 2 +-
include/block/block.h | 1 +
4 files changed, 8 insertions(+), 2 deletions(-)

Comments

On 09/13/2013 04:25 AM, Peter Lieven wrote:
> the BDRV_REQ_MAY_UNMAP flag is used to indicate that block driver> is allowed to optimze a write zeroes request by unmapping (discarding)
s/optimze/optimize/
> blocks if it is guaranteed that the result will read back as> zeroes.> > the flag is only passed to the driver if the block device is> opened with BDRV_O_UNMAP.> > Signed-off-by: Peter Lieven <pl@kamp.de>> ---
> +++ b/include/block/block.h> @@ -65,6 +65,7 @@ typedef struct BlockDevOps {> typedef enum {> BDRV_REQ_COPY_ON_READ = 0x1,> BDRV_REQ_ZERO_WRITE = 0x2,> + BDRV_REQ_MAY_UNMAP = 0x4,
Now that this enum is public, it would be useful to have inline
documentation, rather than making people dig up the git history of when
it was introduced to learn its semantics.