From fb0d8654ffc3ea1494067327fc4c4da5d0872724 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 4 May 2017 21:14:59 -0500 Subject: block: Add BDRV_BLOCK_EOF to bdrv_get_block_status() Just as the block layer already sets BDRV_BLOCK_ALLOCATED as a shortcut for subsequent operations, there are also some optimizations that are made easier if we can quickly tell that *pnum will advance us to the end of a file, via a new BDRV_BLOCK_EOF which gets set by the block layer. This just plumbs up the new bit; subsequent patches will make use of it. Signed-off-by: Eric Blake Message-Id: <20170505021500.19315-2-eblake@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- include/block/block.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index 85e4be7462..4c149adb17 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -129,6 +129,7 @@ typedef struct HDGeometry { * BDRV_BLOCK_OFFSET_VALID: an associated offset exists for accessing raw data * BDRV_BLOCK_ALLOCATED: the content of the block is determined by this * layer (short for DATA || ZERO), set by block layer + * BDRV_BLOCK_EOF: the returned pnum covers through end of file for this layer * * Internal flag: * BDRV_BLOCK_RAW: used internally to indicate that the request was @@ -157,6 +158,7 @@ typedef struct HDGeometry { #define BDRV_BLOCK_OFFSET_VALID 0x04 #define BDRV_BLOCK_RAW 0x08 #define BDRV_BLOCK_ALLOCATED 0x10 +#define BDRV_BLOCK_EOF 0x20 #define BDRV_BLOCK_OFFSET_MASK BDRV_SECTOR_MASK typedef QSIMPLEQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry) BlockReopenQueue; -- cgit v1.2.3-55-g7522