From d1a764d126aa9bd1b519855607f55daf266b07bf Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Wed, 21 Oct 2020 17:58:44 +0300 Subject: block: introduce BDRV_REQ_NO_WAIT flag Add flag to make serialising request no wait: if there are conflicting requests, just return error immediately. It's will be used in upcoming preallocate filter. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20201021145859.11201-7-vsementsov@virtuozzo.com> Signed-off-by: Max Reitz --- include/block/block.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index a3f3dcc88f..a193545b6a 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -77,8 +77,15 @@ typedef enum { * written to qiov parameter which may be NULL. */ BDRV_REQ_PREFETCH = 0x200, + + /* + * If we need to wait for other requests, just fail immediately. Used + * only together with BDRV_REQ_SERIALISING. + */ + BDRV_REQ_NO_WAIT = 0x400, + /* Mask of valid flags */ - BDRV_REQ_MASK = 0x3ff, + BDRV_REQ_MASK = 0x7ff, } BdrvRequestFlags; typedef struct BlockSizes { -- cgit v1.2.3-55-g7522