summaryrefslogtreecommitdiff
path: root/include/block/block.h
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2013-10-24 12:06:52 +0200
committerKevin Wolf <kwolf@redhat.com>2013-11-28 10:30:51 +0100
commitd32f35cbc5a87af5e1100dd55074a79fc2cb5307 (patch)
tree55fa60fcbf692789af57904cb5bc84be7b649df7 /include/block/block.h
parentaa7bfbfff792538a9eeefe879fc4c629aa0b4203 (diff)
downloadqemu-d32f35cbc5a87af5e1100dd55074a79fc2cb5307.zip
block: introduce BDRV_REQ_MAY_UNMAP request flag
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block/block.h')
-rw-r--r--include/block/block.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 8ba9f0c80f..1f30a56fb0 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -65,6 +65,13 @@ typedef struct BlockDevOps {
typedef enum {
BDRV_REQ_COPY_ON_READ = 0x1,
BDRV_REQ_ZERO_WRITE = 0x2,
+ /* The BDRV_REQ_MAY_UNMAP flag is used to indicate that the block driver
+ * is allowed to optimize 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.
+ */
+ BDRV_REQ_MAY_UNMAP = 0x4,
} BdrvRequestFlags;
#define BDRV_O_RDWR 0x0002